When you write a text file, it BufferedWriterdoes not write it to disk immediately. Instead, it stores data in a buffer in memory.
This has the advantage that many small records will go into the buffer, and then the data will be written to disk at a time, i.e. with one big record, and not with many small records, which would be inefficient.
, BufferedWriter , .. , flush(), .
, flush() ?
. , , , , , , .
, flush(), .
flush(). close(), , flush() close() .