Java Reference
In-Depth Information
Using Java's Character-Based Streams
As the preceding sections have shown, Java's byte streams are both powerful and flexible.
However, they are not the ideal way to handle character-based I/O. For this purpose, Java
defines the character stream classes. At the top of the character stream hierarchy are the
abstract classes
Reader
and
Writer
.
Table 10-7
shows the methods in
Reader
, and
Table
10-8
shows the methods in
Writer
. Most of the methods can throw an
IOException
on
error. The methods defined by these two abstract classes are available to all of their sub-
classes. Thus, they form a minimal set of I/O functions that all character streams will have.
Table 10-7
The Methods Defined by
Reader