Java Reference
In-Depth Information
A range of classes that define various types of streamsfiltered
streams, buffered streams, piped streams, and some specific in-
stances of those streams, such as a line number reader and a
stream tokenizerare discussed in Section 20.5 .
The data stream classes and interfaces for reading and writing
primitive values and strings are discussed in Section 20.6 .
Classes and interfaces for interacting with files in a system inde-
pendent manner are discussed in Section 20.7 .
The classes and interfaces that form the object serialization
mechanism, which transforms objects into byte streams and al-
lows objects to be reconstituted from the data read from a byte
stream, are discussed in Section 20.8 .
Some of the output streams provide convenience methods for producing
formatted output, using instances of the java.util.Formatter class. You
get formatted input by binding an input stream to a java.util.Scanner
object. Details of formatting and scanning are covered in Chapter 22 .
The IOException class is used by many methods in java.io to signal ex-
ceptional conditions. Some extended classes of IOException signal spe-
cific problems, but most problems are signaled by an IOException object
with a descriptive string. Details are provided in Section 20.9 on page
563 . Any method that throws an IOException will do so when an error
occurs that is directly related to the stream. In particular, invoking a
method on a closed stream may result in an IOException . Unless there
are particular circumstances under which the IOException will be thrown,
this exception is not documented for each individual method of each
class.
Similarly, NullPointerException and IndexOutOfBoundsException can be ex-
pected to be thrown whenever a null reference is passed to a method,
or a supplied index accesses outside of an array. Only those situations
where this does not occur are explicitly documented.
 
Search WWH ::




Custom Search