Assuming I have 2 threads, one is writing to a FileOutputStream
and one is reading from a FileInputStream
.
The first thread has written x bytes.
When are the bytes considered as ready for reads?
The flush()
method has an empty implementation on FileOutputStream
, so flushing does not do anything.
My assumption is that once I wrote to the FileOutputStream
bytes are ready to read.
An example of real life FileOutputStream
and FileInputStream
that will prove that after performing out.write()
the bytes written are not ready to be consumed by in.read()
will be much appreciated. A proof of the opposite will be even more appreciated.