NIO

In Java, file I/O has undergone a number of revisions over the years. 
The first version of file I/O available in Java was the java.io API. The java.io API uses byte streams to interact with file data. Although the java.io API has grown over the years, the underlying byte stream concept has not changed significantly since it was introduced.  
Java introduced a replacement for java.io streams in Java 1.4 called Non-blocking I/O, or NIO for short. The NIO API introduced the concepts of buffers and channels in place of java.io streams. The basic idea is that you load the data from a file channel into a temporary buffer that, unlike byte streams, can be read forward and backward without blocking on the underlying resource. 
Java 7 introduced the NIO.2 API. People sometimes refer to NIO.2 as just NIO, although for clarity and to distinguish it from the first version of NIO, we will refer to it as NIO.2.