Blocking in terms of java.io/java.nio

后端 未结 3 1891
北海茫月
北海茫月 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:22

    'Blocking' means that the I/O method you are calling blocks the calling thread until at least some data has been transferred, or until an accept or connect operation has either succeede or failed.

    'Non-blocking' means that if no data can be transferred, the I/O method returns immediately with an appropriate return value or exception, or that a connect operation proceeds in the background and can be checked for completion later.

    For completeness, 'asynchronous' means that the I/O method returns immediately but the operation continues in the background, with its result available via another call in due course, or a callback.

提交回复
热议问题