As the name suggests, BufferedWriter uses a buffer to reduce recording costs. If you are writing a file, you may know that a 1 byte record or a 4 kbyte record is approximately the same. The time required to perform such a recording is mainly determined by the access time (~ 8 ms), which is the time required to rotate the disk and to search for the desired sector.
In addition, the aggregation of small records in a larger volume can reduce the operating system overhead, providing better performance.
Most operating systems have an internal buffer for caching entries. However, these caches try to figure out what the application does by analyzing write patterns. If the application itself can perform this caching and write only when the data is ready, the result (in terms of performance) is better.
source share