Java Reference
In-Depth Information
Figure 8-4.
LineNumberInputStream
and
StringBufferInputStream
are deprec-
ated.
LineNumberInputStream
and
StringBufferInputStream
havebeende-
precatedbecausetheydon'tsupportdifferentcharacterencodings,atopicIdiscusslater
inthischapter.
LineNumberReader
and
StringReader
aretheirreplacements.(I
discuss readers later in this chapter.)
Note
PrintStream
isanotherclassthatshouldbedeprecatedbecauseitdoesn't
support different character encodings;
PrintWriter
is its replacement. However,
it's doubtful that Oracle will deprecate this class because
PrintStream
is the type
ofthe
System
class's
out
and
err
classfields;toomuchlegacycodedependsupon
this fact.
Other Java packages provide additional output stream and input stream classes. For
example,
java.util.zip
providesfiveoutputstreamclassesthatcompressuncom-
pressed data into various formats, and five matching input stream classes that uncom-
press compressed data from the same formats:
•
CheckedOutputStream
•
CheckedInputStream
•
DeflaterOutputStream
•
DeflaterInputStream