Blocking in terms of java.io/java.nio

后端 未结 3 1926
北海茫月
北海茫月 2021-01-29 09:02

I just read ...

Classes that work with streams are located in two packages: java.io and java.nio. Classes from the former implement blocking of input/

3条回答
  •  半阙折子戏
    2021-01-29 09:10

    Blocking basically refers to when a thread invokes a read() or write(), it is blocked from doing anything else until there is some data to read or the data is written. The thread can do NOTHING else in the meantime.

    So blocking is to do with the thread itself, not the data source.

提交回复
热议问题