I - NIO

(1) Compared with traditional BIO

BIO means blocking IO. InputStream and OutputStream that we often use are blocking IO. Once blocked, the thread will lose the right to use the CPU, and then enter an infinite wait.

NIO can use IO non-blocking. For example, when the thread reads data from the channel to the buffer, the thread can do other things, and then come back to operate the data when the data is read and written.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324621114&siteId=291194637