O'Reilly logo

Java I/O, NIO and NIO.2 by Jeff Friesen

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    4

Streams

Along with java.io.File and java.io.RandomAccessFile, Java’s classic I/O infrastructure provides streams for performing I/O operations. A stream is an ordered sequence of bytes of an arbitrary length. Bytes flow over an output stream from an application to a destination and flow over an input stream from a source to an application.

Java provides classes in the java.io package that identify various stream destinations for writing; for example, byte arrays, files, and thread pipes. Java also provides classes in this package that identify various stream sources for reading. Examples include byte arrays, files, and thread pipes. This chapter explores many of these classes.

Stream Classes Overview

The java.io package provides ...

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