IOException
Stay organized with collections
Save and categorize content based on your preferences.
Known Direct Subclasses
CharConversionException,
CharacterCodingException,
ClosedChannelException,
EOFException,
FileLockInterruptionException,
FileNotFoundException,
FileSystemException,
HttpRetryException,
InterruptedByTimeoutException,
InterruptedIOException,
InvalidPropertiesFormatException,
MalformedURLException,
ObjectStreamException,
ProtocolException,
SSLException,
and
8 others.
|
Known Indirect Subclasses
AccessDeniedException,
AsynchronousCloseException,
AtomicMoveNotSupportedException,
BindException,
ClosedByInterruptException,
ConnectException,
DirectoryNotEmptyException,
FileAlreadyExistsException,
FileSystemLoopException,
InvalidClassException,
InvalidObjectException,
JarException,
MalformedInputException,
NoRouteToHostException,
NoSuchFileException,
and
14 others.
AccessDeniedException |
Checked exception thrown when a file system operation is denied, typically
due to a file permission or other access check. |
AsynchronousCloseException |
Checked exception received by a thread when another thread closes the
channel or the part of the channel upon which it is blocked in an I/O
operation. |
AtomicMoveNotSupportedException |
Checked exception thrown when a file cannot be moved as an atomic file system
operation. |
BindException |
Signals that an error occurred while attempting to bind a
socket to a local address and port. |
ClosedByInterruptException |
Checked exception received by a thread when another thread interrupts it
while it is blocked in an I/O operation upon a channel. |
ConnectException |
Signals that an error occurred while attempting to connect a
socket to a remote address and port. |
DirectoryNotEmptyException |
Checked exception thrown when a file system operation fails because a
directory is not empty. |
FileAlreadyExistsException |
Checked exception thrown when an attempt is made to create a file or
directory and a file of that name already exists. |
FileSystemLoopException |
Checked exception thrown when a file system loop, or cycle, is encountered. |
InvalidClassException |
Thrown when the Serialization runtime detects one of the following
problems with a Class. |
InvalidObjectException |
Indicates that one or more deserialized objects failed validation
tests. |
JarException |
Signals that an error of some sort has occurred while reading from
or writing to a JAR file. |
MalformedInputException |
Checked exception thrown when an input byte sequence is not legal for given
charset, or an input character sequence is not a legal sixteen-bit Unicode
sequence. |
NoRouteToHostException |
Signals that an error occurred while attempting to connect a
socket to a remote address and port. |
NoSuchFileException |
Checked exception thrown when an attempt is made to access a file that does
not exist. |
NotActiveException |
Thrown when serialization or deserialization is not active. |
NotDirectoryException |
Checked exception thrown when a file system operation, intended for a
directory, fails because the file is not a directory. |
NotLinkException |
Checked exception thrown when a file system operation fails because a file
is not a symbolic link. |
NotSerializableException |
Thrown when an instance is required to have a Serializable interface. |
OptionalDataException |
Exception indicating the failure of an object read operation due to
unread primitive data, or the end of data belonging to a serialized
object in the stream. |
PortUnreachableException |
Signals that an ICMP Port Unreachable message has been
received on a connected datagram. |
SSLHandshakeException |
Indicates that the client and server could not negotiate the
desired level of security. |
SSLKeyException |
Reports a bad SSL key. |
SSLPeerUnverifiedException |
Indicates that the peer's identity has not been verified. |
SSLProtocolException |
Reports an error in the operation of the SSL protocol. |
SocketTimeoutException |
Signals that a timeout has occurred on a socket read or accept. |
StreamCorruptedException |
Thrown when control information that was read from an object stream
violates internal consistency checks. |
UnmappableCharacterException |
Checked exception thrown when an input character (or byte) sequence
is valid but cannot be mapped to an output byte (or character)
sequence. |
WriteAbortedException |
Signals that one of the ObjectStreamExceptions was thrown during a
write operation. |
|
Signals that an I/O exception of some sort has occurred. This
class is the general class of exceptions produced by failed or
interrupted I/O operations.
Public Constructor Summary
|
IOException()
Constructs an IOException with null
as its error detail message.
|
|
IOException( String message)
Constructs an IOException with the specified detail message.
|
|
|
|
IOException( Throwable cause)
Constructs an IOException with the specified cause and a
detail message of (cause==null ? null : cause.toString())
(which typically contains the class and detail message of cause ).
|
Inherited Method Summary
From class
java.lang.Throwable
synchronized
final
void
|
addSuppressed( Throwable exception)
Appends the specified exception to the exceptions that were
suppressed in order to deliver this exception.
|
synchronized
Throwable
|
|
synchronized
Throwable
|
getCause()
Returns the cause of this throwable or null if the
cause is nonexistent or unknown.
|
String
|
|
String
|
getMessage()
Returns the detail message string of this throwable.
|
StackTraceElement[]
|
|
synchronized
final
Throwable[]
|
getSuppressed()
Returns an array containing all of the exceptions that were
suppressed, typically by the try -with-resources
statement, in order to deliver this exception.
|
synchronized
Throwable
|
initCause( Throwable cause)
Initializes the cause of this throwable to the specified value.
|
void
|
printStackTrace()
Prints this throwable and its backtrace to the
standard error stream.
|
void
|
|
void
|
|
void
|
|
String
|
toString()
Returns a short description of this throwable.
|
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals( Object obj)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait(long timeout, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long timeout)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
Public Constructors
public
IOException
()
Constructs an IOException
with null
as its error detail message.
public
IOException
(String message)
Constructs an IOException
with the specified detail message.
public
IOException
(String message, Throwable cause)
Constructs an IOException
with the specified detail message
and cause.
Note that the detail message associated with cause
is
not automatically incorporated into this exception's detail
message.
Parameters
message |
The detail message (which is saved for later retrieval
by the Throwable.getMessage() method) |
cause |
The cause (which is saved for later retrieval by the
Throwable.getCause() method). (A null value is permitted,
and indicates that the cause is nonexistent or unknown.) |
public
IOException
(Throwable cause)
Constructs an IOException
with the specified cause and a
detail message of (cause==null ? null : cause.toString())
(which typically contains the class and detail message of cause
).
This constructor is useful for IO exceptions that are little more
than wrappers for other throwables.
Parameters
cause |
The cause (which is saved for later retrieval by the
Throwable.getCause() method). (A null value is permitted,
and indicates that the cause is nonexistent or unknown.) |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["`IOException` is a general exception class signaling failed or interrupted input/output operations in Java."],["It serves as the parent class for many more specific I/O exception types, like `FileNotFoundException` and `EOFException`."],["`IOException` can be constructed with an optional detailed message and/or a cause for the exception."],["It inherits methods from `Throwable` for handling stack traces and related diagnostic information."],["Developers can use `IOException` to catch and handle a broad range of I/O errors, or use its subclasses for more targeted error management."]]],["`IOException` is a class extending `Exception`, signaling an I/O operation failure or interruption. It has multiple subclasses, including `FileNotFoundException` and `MalformedURLException`, and others, categorized as direct and indirect subclasses. Key actions include constructing `IOException` instances with or without a detail message and cause. Methods related to exception handling like retrieving messages, causes, and stack traces are also included, along with methods inherited from `Throwable` and `Object`.\n"]]