java .flush in the write () method

This is a buffer problem.

        When using the java flow, there will be a buffer, according to one kind it considered to be more efficient ways to send data: the first to send data into the buffer, and then after a one-time buffer is filled with hair in the past, rather than separately again and again made while flush () indicates a mandatory to send data out of the buffer, without waiting for the buffer is full.

        So if the stream of time, this method is not, in many cases there will be a flush () the other side of the stream can not read data problem, especially in the data particularly small.

Guess you like

Origin blog.csdn.net/weixin_42591732/article/details/94281705