When to flush a BufferedWriter

后端 未结 3 1938
滥情空心
滥情空心 2020-12-05 04:28

In a Java program (Java 1.5), I have a BufferedWriter that wraps a Filewriter, and I call write() many many times... The resulting file is pretty big...

Among the li

3条回答
  •  独厮守ぢ
    2020-12-05 04:48

    The ideal flushing moment is when you need another program reading the file to see the data that's been written, before the file is closed. In many cases, that's never.

提交回复
热议问题