296 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
108
views
Kotlin: Convert binary InputStream to base64 string in blocks / buffered?
I currently try to read a given inputStream as base64 encoded string in Kotlin. Sadly, it crashes the whole Android application with out of memory error as soon as the file is bigger than around 20 ...
2
votes
1
answer
409
views
Timeout error when reading large blobs in Azure container through Java SDK
I am trying to read the InputStream of a large blob from an Azure container and store it in another cloud storage of my own.
For small files, it is working perfectly. But for large blobs (around 3GB), ...
0
votes
0
answers
53
views
BufferedInputStream vs DataInputStream which is faster for sending byte arrays? [duplicate]
My question is straight forward. I made an app with java sockets which can send as many files as you want between two users.However, sometimes transfer can be slow and i think it is because i am ...
0
votes
1
answer
339
views
Performance comparison: BufferedInputStream vs. Unbuffered Streams in Java
I created a file with 1,000,000 zeroes in it (980K) and measure how fast to copies it to another file (using buffered and non-buffered for both input and output) with default buffer size (8192 bytes). ...
-4
votes
3
answers
235
views
I don't understand this criticism of my code for comparing the byte-content of files
I asked for some review of the code below the other day. It's code I'm working on to compare the byte-content of files suspected to be identical; it should work with files of any file-type and any ...
1
vote
1
answer
425
views
Why does buffered i/o take longer than direct i/o with bigger write-buffer?
I have tested i/o performance and noticed an interesting behaviour that I can not explain.
There is one program that first sets the stream-buffer to 4096 bytes and then writes one byte for 100.000.000 ...
2
votes
0
answers
76
views
BufferedReader on top of BufferedInputStream VS BufferedReader on top of FileInputStream
Is there any performance gain if we have:
BufferedReader reader = new BufferedReader(new InputStreamReader(new BufferedInputStream(new FileInputStream("SOME_FILE")), StandardCharsets.UTF_8))
...
0
votes
2
answers
1k
views
BufferedInputStream reads the entire file once even though I set the buffer size to 1?
I was running the code below to try and understand how BufferedInputStream works in Java. I set the buffer size to 1 and was expecting the buffer to read the file 465 times because that is how much ...
0
votes
1
answer
4k
views
How can I properly use Zig's buffered writer and reader without incomplete or strange output?
When using the buffered writer and reader, my output is sometimes incomplete or behaves strangely. This is seemingly caused by the string formatting of my final output message.
After following this ...
-2
votes
1
answer
42
views
1. How to avoid NZEC error in java? 2. Is this the correct way to take inputs for test cases
!(https://i.sstatic.net/UpHxf.png)
When I run the code on my Eclipse IDE , it reads the input properly through the console but when I try to submit the code on SPOJ , the compiler throws NZEC error
I ...
0
votes
1
answer
175
views
Force BufferedInputStream to return captured content
I have a Spring Boot REST application with 2 endpoints: first starts the Process (db shell) with a command like 'mysql -e root'. Second one accepts command (query) and writes it to OutputStream (which ...
1
vote
2
answers
279
views
Why BufferedInputStream(InputStream in, int bufSize) is not reading data in chunks of bufSize from the inputStream while using mark()?
Here is my code:
import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.IOException;
public class MarkAndResetDemo {
public static void main(String[] args) {
...
0
votes
0
answers
150
views
Java BufferedInputStream.read() fails
I am working on an android app that has continuous communication between the phone and a local server on the computer through cable and Android Open Accessory connection(AOA), the server(the computer) ...
0
votes
1
answer
575
views
BufferedReader - Output columns in in different order JAVA
I have 2 csv files with column 'car', 'bike', 'tractor' etc
The below code prints out data from the csv which works fine, however cvs 1 prints out in a different or to csv 2 so I want to arrange the ...
1
vote
1
answer
1k
views
Reading data from a file inside a zip file in java without extracting the Zip
I need to read a file inside a zip folder without extracting Zip the zip folder then I need to keep all the data in that file in a buffer.
public static void getLogBuffers(String path) throws ...