Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: Roedy Green Newsgroups: comp.lang.java.help Subject: FileOutputStream questions Date: Tue, 25 Dec 2012 06:36:29 -0800 Organization: Canadian Mind Products Lines: 21 Message-ID: Reply-To: Roedy Green NNTP-Posting-Host: K2Qzzs3EAqXk5RLzfhxcSw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Forte Agent 6.00/32.1186 Xref: csiph.com comp.lang.java.help:2380 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? -- 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.