Java Reference
In-Depth Information
20.3. Character Streams
The abstract classes for reading and writing streams of characters are
Reader and Writer . Each supports methods similar to those of its byte
stream counterpart InputStream and OutputStream , respectively. For ex-
ample, InputStream has a read method that returns a byte as the lowest
8 bits of an int , and Reader has a read method that returns a char as
the lowest 16 bits of an int . And where OutputStream has methods that
write byte arrays, Writer has methods that write char arrays. The charac-
ter streams were designed after the byte streams to provide full support
for working with Unicode characters, and in the process the contracts of
the classes were improved to make them easier to work with. The type
tree for the character streams of java.io appears in Figure 20-2 .
 
Search WWH ::




Custom Search