Instead of sending every bit of information as soon as you write it to the output stream, it stores what you wrote in memory until it receives โsufficientโ data, which, in his opinion, takes time, to send to his client. The size of the buffer can vary greatly depending on the context and the reason for buffering the data. To "flush" the buffer, it is necessary to process all the pending data in the buffer (in this case, the processing tool sends it over the network to the client). What end does in your case.
Buffering can be performed for many reasons, but this is usually a matter of performance. It would be very wasteful and time consuming if you sent a network packet for each character that you wrote to your stream, or (in many cases) every line passed to Write . The application will execute faster by sending fewer and more packets of information.
Servy source share