Java Reference
In-Depth Information
Readers and Writers
Input and output streams are byte-based streams. In this section, I will discuss readers and writers, which are
character-based streams. A reader is used when you want to read character-based data from a data source. A writer is
used when you want to write character-based data to a data sink.
Figure 7-8 and Figure 7-9 show some classes, and the relationship between them, for the Reader and Writer stream
families. Recall that the input and output stream class names end with the words “InputStream” and “OutputStream,”
respectively. The Reader and Writer class names end with the words “Reader” and “Writer,” respectively.
Figure 7-8. Commonly used classes for Reader streams compared with the decorator pattern
 
Search WWH ::




Custom Search