10. Basic I/O and NIO.2

This chapter covers the Java platform classes used for basic I/O. It first focuses on I/O streams, a powerful concept that greatly simplifies I/O operations. The chapter also looks at serialization, which lets a program write whole objects out to streams and read them back again. Then the chapter looks at file I/O and file system operations, including random access files.

Most of the classes covered in the section “I/O Streams” are in the java.io package. Most of the classes covered in the section “File I/O” are in the java.nio.file package.

I/O Streams

An I/O stream represents an input ...

Get The Java® Tutorial: A Short Course on the Basics, Fifth Edition now with the O’Reilly learning platform.

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