













Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!














To bring in information, a program opens a
stream on an information source (a file, memory, a socket) and reads the information sequentially, as shown in the following figure.
Similarly, a program can send information to an external destination by opening a stream to a destination and writing the information out sequentially, as shown in the following figure.
superclasses for character streams in java.io.
implementation for readers ( streams that read 16-bit characters ) and Writer provides the API and partial implementation for writers ( streams that write 16-bit characters).
hierarchies for the Reader and Writer classes.
write binary data such as images and sounds.
ObjectInputStream and ObjectOutputStream, are used for object serialization.
The file streams-- FileReader , FileWriter , FileInputStream , and FileOutputStream -- read or write from a file on the native file system. Here is simple code to create a file reader File inputFile = new File("farrago.txt"); FileReader in = new FileReader(inputFile); FileWriter out = new FileWriter(outputFile); This reads characters from the reader as long as there's more input in the input file and writes those characters to the writer.
one thread into the input of another. PipedReader and PipedWriter (and their input and output stream counterparts PipedInputStream and PipedOutputStream ) implement the input and output components of a pipe.
communication between objects via sockets
object for use in a later invocation of the same program.