Added in API level 1

IOException

public class IOException
extends Exception

java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ java.io.IOException
Base64DataException This exception is thrown by Base64InputStream or Base64OutputStream when an error is detected in the data being decoded. 
BluetoothSocketException Thrown when an error occurs during a Bluetooth Socket related exception. 
CharConversionException Base class for character conversion exceptions. 
CharacterCodingException Checked exception thrown when a character encoding or decoding error occurs. 
ClosedChannelException Checked exception thrown when an attempt is made to invoke or complete an I/O operation upon channel that is closed, or at least closed to that operation. 
EOFException Signals that an end of file or end of stream has been reached unexpectedly during input. 
FileLockInterruptionException Checked exception received by a thread when another thread interrupts it while it is waiting to acquire a file lock. 
FileNotFoundException Signals that an attempt to open the file denoted by a specified pathname has failed. 
FileSystemException Thrown when a file system operation fails on one or two files. 
HttpException Base exception passed to UrlRequest.Callback.onFailed()
HttpRetryException Thrown to indicate that a HTTP request needs to be retried but cannot be retried automatically, due to streaming mode being enabled. 
IkeTimeoutException This exception is thrown when there is an IKE retransmission timeout. 
ImageDecoder.DecodeException Information about an interrupted decode. 
InterruptedByTimeoutException Checked exception received by a thread when a timeout elapses before an asynchronous operation completes. 
InterruptedIOException Signals that an I/O operation has been interrupted. 
InvalidPropertiesFormatException Thrown to indicate that an operation could not complete because the input did not conform to the appropriate XML document type for a collection of properties, as per the Properties specification. 
MalformedJsonException Thrown when a reader encounters malformed JSON. 
MalformedURLException Thrown to indicate that a malformed URL has occurred. 
MediaParser.ParsingException Thrown when an error occurs while parsing a media stream. 
MediaParser.UnrecognizedInputFormatException Thrown if all parser implementations provided to MediaParser.create(OutputConsumer, String) failed to sniff the input content. 
ObjectStreamException Superclass of all exceptions specific to Object Stream classes. 
ParcelFileDescriptor.FileDescriptorDetachedException Exception that indicates that the file descriptor was detached. 
ProtocolException Thrown to indicate that there is an error in the underlying protocol, such as a TCP error. 
SSLException Indicates some kind of error detected by an SSL subsystem. 
SocketException Thrown to indicate that there is an error creating or accessing a Socket. 
SyncFailedException Signals that a sync operation has failed. 
TagLostException  
UTFDataFormatException Signals that a malformed string in modified UTF-8 format has been read in a data input stream or by any class that implements the data input interface. 
UnknownHostException Thrown to indicate that the IP address of a host could not be determined. 
UnknownServiceException Thrown to indicate that an unknown service exception has occurred. 
UnsupportedEncodingException The Character Encoding is not supported. 
UserPrincipalNotFoundException Checked exception thrown when a lookup of UserPrincipal fails because the principal does not exist. 
ZipException Signals that a Zip exception of some sort has occurred. 
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. 
CallbackException Exception passed to UrlRequest.Callback.onFailed() when UrlRequest.Callback or UploadDataProvider method throws an exception. 
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. 
ConnectTimeoutException This class was deprecated in API level 22. Please use URL.openConnection() instead. Please visit this webpage for further details. 
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. 
NetworkException Exception passed to UrlRequest.Callback.onFailed() when the HTTP stack fails to process a network request. 
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. 
QuicException Subclass of NetworkException which contains a detailed QUIC error code from QuicErrorCode
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.

Summary

Public constructors

IOException()

Constructs an IOException with null as its error detail message.

IOException(String message)

Constructs an IOException with the specified detail message.

IOException(String message, Throwable cause)

Constructs an IOException with the specified detail message and cause.

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 methods

final void addSuppressed(Throwable exception)

Appends the specified exception to the exceptions that were suppressed in order to deliver this exception.

Throwable fillInStackTrace()

Fills in the execution stack trace.

Throwable getCause()

Returns the cause of this throwable or null if the cause is nonexistent or unknown.

String getLocalizedMessage()

Creates a localized description of this throwable.

String getMessage()

Returns the detail message string of this throwable.

StackTraceElement[] getStackTrace()

Provides programmatic access to the stack trace information printed by printStackTrace().

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.

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 printStackTrace(PrintWriter s)

Prints this throwable and its backtrace to the specified print writer.

void printStackTrace(PrintStream s)

Prints this throwable and its backtrace to the specified print stream.

void setStackTrace(StackTraceElement[] stackTrace)

Sets the stack trace elements that will be returned by getStackTrace() and printed by printStackTrace() and related methods.

String toString()

Returns a short description of this throwable.

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Public constructors

IOException

Added in API level 1
public IOException ()

Constructs an IOException with null as its error detail message.

IOException

Added in API level 1
public IOException (String message)

Constructs an IOException with the specified detail message.

Parameters
message String: The detail message (which is saved for later retrieval by the Throwable.getMessage() method)

IOException

Added in API level 9
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 String: The detail message (which is saved for later retrieval by the Throwable.getMessage() method)

cause Throwable: 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.)

IOException

Added in API level 9
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 Throwable: 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.)