Streams

Java input and output are based on the use of streams, which are sequences of bytes or characters that travel from a source to a destination over a communication path. If your program is writing to a stream, that program is the stream's source. If your program is reading from a stream, it is the stream's destination. The communication path is dependent on the type of I/Os being performed. It can consist of memory-to-memory transfers, a file system, a network, and other forms of I/O.

Streams are not complicated. They are powerful because they abstract the details of the communication path from input and output operations. This enables all I/Os to be performed using a common set of methods. These methods can be tailored and extended to ...

Get Sun Certification Training Guide (310-025, 310-027): Java™ 2 Programmer and Developer Exams 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.