Java Reference
In-Depth Information
20.9. The
IOException
Classes
Every I/O-specific error detected by classes in
java.io
is signaled by an
IOException
or a subclass. Most I/O classes are designed to be general,
so most of the exceptions cannot be listed specifically. For example,
In-
putStream
methods that throw
IOException
cannot detail which particular
exceptions might be thrown, because any particular input stream class
might throw a subclass of
IOException
for particular error conditions relev-
ant to that stream. And the filter input and output streams pass through
exceptions only from their downstream objects, which can also be of oth-
er stream types.
The specific subclasses of
IOException
used in the
java.io
package are
CharConversionException
extends IOException
Thrown when a character conversion problem occurs in a char-
acter stream operation that must convert local character codes
to Unicode or vice versa.
EOFException
extends IOException
Thrown when the end of the file (stream) is detected while
reading.
FileNotFoundException
extends IOException
Thrown when the attempt to access the file specified by a given
pathname failspresumably because the file does not exist.
InterruptedIOException
extends IOException
Thrown when a blocking I/O operation detects that the current
thread has been interrupted before or during the operation. In
principle, except for the
Print
stream methods, interrupting a
thread should cause this exception if the thread is performing