Roedy Green
2012-12-25 14:36:29 UTC
I have just realised I do not understand some basic things about
unbuffered FileOutputStream.
I used them in two ways, wrapping in a BufferedOutputStream or
BufferedWriter, or writing an entire file in one i/o without
buffering.
If you write single bytes at a time, will you trigger physical I/O on
every byte, or is there some small buffer in there anyway?
I have experimented with flush during file write. The file size stays
at 0 until I close, at least to DIR.
What I want is to log bytes that will be largely recoverable even if
the program terminates unexpectedly without closing. Flush does not do
it. Close/reopen periodically seem at bit heavy handed. Is there
something I am missing?
unbuffered FileOutputStream.
I used them in two ways, wrapping in a BufferedOutputStream or
BufferedWriter, or writing an entire file in one i/o without
buffering.
If you write single bytes at a time, will you trigger physical I/O on
every byte, or is there some small buffer in there anyway?
I have experimented with flush during file write. The file size stays
at 0 until I close, at least to DIR.
What I want is to log bytes that will be largely recoverable even if
the program terminates unexpectedly without closing. Flush does not do
it. Close/reopen periodically seem at bit heavy handed. Is there
something I am missing?
--
Roedy Green Canadian Mind Products http://mindprod.com
Students who hire or con others to do their homework are as foolish
as couch potatoes who hire others to go to the gym for them.
Roedy Green Canadian Mind Products http://mindprod.com
Students who hire or con others to do their homework are as foolish
as couch potatoes who hire others to go to the gym for them.