O'Reilly logo

Java: A Beginner’s Tutorial, 4th Edition (Updated for Java SE 8) by Budi Kurniawan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 16

Input/Output

Input/output (I/O) is one of the most common operations performed by computer programs. Examples of I/O operations include

  • creating and deleting files
  • reading from and writing to a file or network socket
  • serializing (or saving) objects to persistent storage and retrieving the saved objects

Java support for I/O has been available since JDK 1.0 in the form of the I/O API in the java.io package. JDK 1.4 added the New I/O (NIO) APIs that offer performance improvement in buffer management, scalable network and file I/O. Java NIO APIs are part of the java.nio package and its subpackages. JDK 7 introduced yet a new set of packages called NIO.2 to complement the existing technologies. There is no java.nio2 package. Instead, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required