Chapter 20NIO.2

In Chapter 19, “I/O,” we presented the API and discussed how to use it to interact with files and streams. In this chapter, we focus on the java.nio version 2 API, or NIO.2 for short, to interact with files. NIO.2 is an acronym that stands for the second version of the Non‐blocking Input/Output API, and it is sometimes referred to as the “New I/O.”

In this chapter, we will show how NIO.2 allows us to do a lot more with files and directories than the original API. ...

Get OCP Oracle Certified Professional Java SE 11 Developer Complete Study Guide now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.