Listing 12-35’s use of copy() to copy from the URL’s input stream to the Path’s page.html file results in a much shorter listing than its Listing 12-27 counterpart.

Compile Listing 12-35 (javac SavePage.java) and run the application (java SavePage http://apress.com). You should ...

Get Java I/O, NIO and NIO.2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.