What exactly does “Stream” and “Buffer” mean in Java I/O?

后端 未结 5 2038
北海茫月
北海茫月 2020-12-07 07:10

I just learned about input/output using BufferedReader.

I wanted to know what exactly are the meanings of the term Stream and Buffer<

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-07 07:31

    A stream is the connection and actual information being passed between points. The buffer is a storage container which stores part or all of the streamed data and feeds this to the output device.

    Of course, the point being that if the stream slows beyond the data rate required to show the data, then the output would pause. The buffer prevents this.

提交回复
热议问题