Extra Q needed between buffered socket read and buffered file write? (multithreaded)
I have some code that reads from a socket via an input stream created as:
and writes to a file via an output stream created as:
dataInStream = new BufferedInputStream(dataSocket.getInputStream());
Both operations are in the same while loop.
outputFile = new BufferedWriter(new FileWriter(filename));
At what point (data rate-wise) might I need to split out the file write operation into another thread
with something like a ConcurrentLinkedQueue between the reader and writer threads?
The expected message rates are low (i.e. 1400 byte msgs at ~10hz)
ANY insights would be very much appreciated! I'd like to hear some rationale one way or the other.