Java NIO (New io) is an alternative IO API for Java (from Java 1.4), meaning alternative to the standardJava IO A nd java Networking API ' s. Java NIO offers a different of working with IO than the standard IO API ' s.
Java Nio:channels and buffers
The standard IO API is the streams and character streams with byte. In NIO channels and buffers. Data is all read from a channel into a buffer, or written from a buffer to a channel.
Java nio:non-blocking IO
Java NIO enables do non-blocking IO. For instance, a thread can ask a channel to read data into a buffer. While the channel reads data to the buffer, the thread can do something else. Once data is read to the buffer, the thread can then continue processing it. The same is true for writing data to channels.
Java nio:selectors
Java NIO contains the concept of "selectors". A Selector is an object that can monitor multiple channels for events (Like:connection opened, data arrived etc). Thus, a single thread can monitor multiple channels for data.
How all this works was explained in more detail with the next text in this series-the Java NIO Overview.
Java NIO Tutorial