What is buffer

 A buffer is a temporary storage area that is used to store data that is being read from or written to a file. Buffers are used to improve performance by reducing the number of times that the operating system needs to access the file.

When you open a file, the operating system will create a buffer for the file. The buffer will be used to store data that is being read from or written to the file. When you read data from a file, the data is first copied from the buffer to your program. When you write data to a file, the data is first copied from your program to the buffer.

The size of the buffer is determined by the operating system. The operating system will choose a buffer size that is large enough to improve performance without using too much memory.

Post a Comment

Previous Post Next Post