15.7.1 Interfaces and Classes for Byte-Based Input and Output

InputStream and OutputStream are abstract classes that declare methods for performing byte-based input and output, respectively.

Pipe Streams

Pipes are synchronized communication channels between threads. We discuss threads in Chapter 23. Java provides PipedOutputStream (a subclass of OutputStream) and Piped- InputStream (a subclass of InputStream) to establish pipes between two threads in a program. One thread sends data to another by writing to a PipedOutputStream. The target thread reads information from the pipe via a PipedInputStream.

Filter Streams

A FilterInputStream filters an InputStream, and a FilterOutputStream filters an OutputStream. Filtering means simply that the ...

Get Java™ How To Program (Early Objects), Tenth Edition 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.