Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

# java.nio.channels

Defines channels, which represent connections to entities that are capable of performing I/O operations, such as files and sockets; defines selectors, for multiplexed, non-blocking I/O operations.

| Channels | Description |
| *`https://developer.android.com/reference/java/nio/channels/Channel`* | A nexus for I/O operations |
| *`https://developer.android.com/reference/java/nio/channels/ReadableByteChannel`* | Can read into a buffer |
| *`https://developer.android.com/reference/java/nio/channels/ScatteringByteChannel`* | Can read into a sequence of buffers |
| *`https://developer.android.com/reference/java/nio/channels/WritableByteChannel`* | Can write from a buffer |
| *`https://developer.android.com/reference/java/nio/channels/GatheringByteChannel`* | Can write from a sequence of buffers |
| *`https://developer.android.com/reference/java/nio/channels/ByteChannel`* | Can read/write to/from a buffer |
| *`https://developer.android.com/reference/java/nio/channels/SeekableByteChannel`* | A `ByteChannel` connected to an entity that contains a variable-length sequence of bytes |
| *`https://developer.android.com/reference/java/nio/channels/AsynchronousChannel`* | Supports asynchronous I/O operations. |
| *`https://developer.android.com/reference/java/nio/channels/AsynchronousByteChannel`* | Can read and write bytes asynchronously |
| *`https://developer.android.com/reference/java/nio/channels/NetworkChannel`* | A channel to a network socket |
| *`https://developer.android.com/reference/java/nio/channels/MulticastChannel`* | Can join Internet Protocol (IP) multicast groups |
| `https://developer.android.com/reference/java/nio/channels/Channels` | Utility methods for channel/stream interoperation |
|---|---|
[Lists channels and their descriptions]

A *channel* represents an open connection to an entity such as a
hardware device, a file, a network socket, or a program component that is
capable of performing one or more distinct I/O operations, for example reading
or writing. As specified in the `https://developer.android.com/reference/java/nio/channels/Channel` interface,
channels are either open or closed, and they are both *asynchronously closeable* and *interruptible*.

The `https://developer.android.com/reference/java/nio/channels/Channel` interface is extended by several
other interfaces.

The `https://developer.android.com/reference/java/nio/channels/ReadableByteChannel` interface specifies a
`https://developer.android.com/reference/java/nio/channels/ReadableByteChannel#read(java.nio.ByteBuffer)` method that reads bytes
from the channel into a buffer; similarly, the `https://developer.android.com/reference/java/nio/channels/WritableByteChannel` interface specifies a `https://developer.android.com/reference/java/nio/channels/WritableByteChannel#write(java.nio.ByteBuffer)` method that writes bytes
from a buffer to the channel. The `https://developer.android.com/reference/java/nio/channels/ByteChannel`
interface unifies these two interfaces for the common case of channels that can
both read and write bytes. The `https://developer.android.com/reference/java/nio/channels/SeekableByteChannel`
interface extends the `ByteChannel` interface with methods to `https://developer.android.com/reference/java/nio/channels/SeekableByteChannel#position()` and `https://developer.android.com/reference/java/nio/channels/SeekableByteChannel#position(long)` the channel's
current position, and its `https://developer.android.com/reference/java/nio/channels/SeekableByteChannel#size()`.

The `https://developer.android.com/reference/java/nio/channels/ScatteringByteChannel` and `https://developer.android.com/reference/java/nio/channels/GatheringByteChannel` interfaces extend the `https://developer.android.com/reference/java/nio/channels/ReadableByteChannel` and `https://developer.android.com/reference/java/nio/channels/WritableByteChannel` interfaces, respectively, adding `https://developer.android.com/reference/java/nio/channels/ReadableByteChannel#read(java.nio.ByteBuffer)` and `https://developer.android.com/reference/java/nio/channels/WritableByteChannel#write(java.nio.ByteBuffer)` methods that take a
sequence of buffers rather than a single buffer.

The `https://developer.android.com/reference/java/nio/channels/NetworkChannel` interface specifies methods
to `https://developer.android.com/reference/java/nio/channels/NetworkChannel#bind(java.net.SocketAddress)` the channel's socket,
obtain the address to which the socket is bound, and methods to `https://developer.android.com/reference/java/nio/channels/NetworkChannel#getOption(java.net.SocketOption<T>)` and `https://developer.android.com/reference/java/nio/channels/NetworkChannel#setOption(java.net.SocketOption<T>,%20T)` socket options. The `https://developer.android.com/reference/java/nio/channels/MulticastChannel` interface specifies methods to join
Internet Protocol (IP) multicast groups.

The `https://developer.android.com/reference/java/nio/channels/Channels` utility class defines static methods
that support the interoperation of the stream classes of the `https://developer.android.com/reference/java/io/package-summary` package with the channel classes of this package. An appropriate
channel can be constructed from an `https://developer.android.com/reference/java/io/InputStream` or an `https://developer.android.com/reference/java/io/OutputStream`, and conversely an `https://developer.android.com/reference/java/io/InputStream` or an
`https://developer.android.com/reference/java/io/OutputStream` can be constructed from a channel. A `https://developer.android.com/reference/java/io/Reader` can be constructed that uses a given charset to decode bytes
from a given readable byte channel, and conversely a `https://developer.android.com/reference/java/io/Writer` can
be constructed that uses a given charset to encode characters into bytes and
write them to a given writable byte channel.

| File channels | Description |
| `https://developer.android.com/reference/java/nio/channels/FileChannel` | Reads, writes, maps, and manipulates files |
| `https://developer.android.com/reference/java/nio/channels/FileLock` | A lock on a (region of a) file |
| `https://developer.android.com/reference/java/nio/MappedByteBuffer` | A direct byte buffer mapped to a region of a file |
|---|---|
[Lists file channels and their descriptions]

The `https://developer.android.com/reference/java/nio/channels/FileChannel` class supports the usual
operations of reading bytes from, and writing bytes to, a channel connected to
a file, as well as those of querying and modifying the current file position
and truncating the file to a specific size. It defines methods for acquiring
locks on the whole file or on a specific region of a file; these methods return
instances of the `https://developer.android.com/reference/java/nio/channels/FileLock` class. Finally, it defines
methods for forcing updates to the file to be written to the storage device that
contains it, for efficiently transferring bytes between the file and other
channels, and for mapping a region of the file directly into memory.

A `FileChannel` is created by invoking one of its static `https://developer.android.com/reference/java/nio/channels/FileChannel#open(java.nio.file.Path,%20java.nio.file.OpenOption[])` methods, or by invoking the `getChannel` method of a `https://developer.android.com/reference/java/io/FileInputStream`, `https://developer.android.com/reference/java/io/FileOutputStream`, or `https://developer.android.com/reference/java/io/RandomAccessFile` to return a
file channel connected to the same underlying file as the `https://developer.android.com/reference/java/io/package-summary`
class.


| Multiplexed, non-blocking I/O | Description |
| `https://developer.android.com/reference/java/nio/channels/SelectableChannel` | A channel that can be multiplexed |
| `https://developer.android.com/reference/java/nio/channels/DatagramChannel` | A channel to a datagram-oriented socket |
| `https://developer.android.com/reference/java/nio/channels/Pipe.SinkChannel` | The write end of a pipe |
| `https://developer.android.com/reference/java/nio/channels/Pipe.SourceChannel` | The read end of a pipe |
| `https://developer.android.com/reference/java/nio/channels/ServerSocketChannel` | A channel to a stream-oriented listening socket |
| `https://developer.android.com/reference/java/nio/channels/SocketChannel` | A channel for a stream-oriented connecting socket |
| `https://developer.android.com/reference/java/nio/channels/Selector` | A multiplexor of selectable channels |
| `https://developer.android.com/reference/java/nio/channels/SelectionKey` | A token representing the registration of a channel with a selector |
| `https://developer.android.com/reference/java/nio/channels/Pipe` | Two channels that form a unidirectional pipe |
|---|---|
[Lists multiplexed, non-blocking channels and their descriptions]

Multiplexed, non-blocking I/O, which is much more scalable than
thread-oriented, blocking I/O, is provided by *selectors*, *selectable channels*, and *selection keys*.

A [*selector*](https://developer.android.com/reference/java/nio/channels/Selector) is a multiplexor of [*selectable channels*](https://developer.android.com/reference/java/nio/channels/SelectableChannel), which in turn are
a special type of channel that can be put into [*non-blocking mode*](https://developer.android.com/reference/java/nio/channels/SelectableChannel#bm). To perform
multiplexed I/O operations, one or more selectable channels are first created,
put into non-blocking mode, and `https://developer.android.com/reference/java/nio/channels/SelectableChannel#register(java.nio.channels.Selector,%20int)`
with a selector. Registering a channel specifies the set of I/O operations
that will be tested for readiness by the selector, and returns a [*selection key*](https://developer.android.com/reference/java/nio/channels/SelectionKey) that represents the
registration.

Once some channels have been registered with a selector, a [*selection operation*](https://developer.android.com/reference/java/nio/channels/Selector#selop) can be performed in
order to discover which channels, if any, have become ready to perform one or
more of the operations in which interest was previously declared. If a channel
is ready then the key returned when it was registered will be added to the
selector's *selected-key set*. The key set, and the keys within it, can
be examined in order to determine the operations for which each channel is
ready. From each key one can retrieve the corresponding channel in order to
perform whatever I/O operations are required.

That a selection key indicates that its channel is ready for some operation
is a hint, but not a guarantee, that such an operation can be performed by a
thread without causing the thread to block. It is imperative that code that
performs multiplexed I/O be written so as to ignore these hints when they prove
to be incorrect.

This package defines selectable-channel classes corresponding to the `https://developer.android.com/reference/java/net/DatagramSocket`, `https://developer.android.com/reference/java/net/ServerSocket`, and `https://developer.android.com/reference/java/net/Socket` classes defined in the `https://developer.android.com/reference/java/net/package-summary` package.
Minor changes to these classes have been made in order to support sockets that
are associated with channels. This package also defines a simple class that
implements unidirectional pipes. In all cases, a new selectable channel is
created by invoking the static `open` method of the corresponding class.
If a channel needs an associated socket then a socket will be created as a side
effect of this operation.

The implementation of selectors, selectable channels, and selection keys
can be replaced by "plugging in" an alternative definition or instance of the
`https://developer.android.com/reference/java/nio/channels/spi/SelectorProvider` class defined in the `https://developer.android.com/reference/java/nio/channels/spi/package-summary` package. It is not expected that many developers
will actually make use of this facility; it is provided primarily so that
sophisticated users can take advantage of operating-system-specific
I/O-multiplexing mechanisms when very high performance is required.

Much of the bookkeeping and synchronization required to implement the
multiplexed-I/O abstractions is performed by the `https://developer.android.com/reference/java/nio/channels/spi/AbstractInterruptibleChannel`, `https://developer.android.com/reference/java/nio/channels/spi/AbstractSelectableChannel`, `https://developer.android.com/reference/java/nio/channels/spi/AbstractSelectionKey`, and `https://developer.android.com/reference/java/nio/channels/spi/AbstractSelector` classes in the `https://developer.android.com/reference/java/nio/channels/spi/package-summary` package. When defining a custom selector provider,
only the `https://developer.android.com/reference/java/nio/channels/spi/AbstractSelector` and `https://developer.android.com/reference/java/nio/channels/spi/AbstractSelectionKey` classes should be subclassed
directly; custom channel classes should extend the appropriate `https://developer.android.com/reference/java/nio/channels/SelectableChannel` subclasses defined in this package.


| Asynchronous I/O | Description |
| `https://developer.android.com/reference/java/nio/channels/AsynchronousFileChannel` | An asynchronous channel for reading, writing, and manipulating a file |
| `https://developer.android.com/reference/java/nio/channels/AsynchronousSocketChannel` | An asynchronous channel to a stream-oriented connecting socket |
| `https://developer.android.com/reference/java/nio/channels/AsynchronousServerSocketChannel` | An asynchronous channel to a stream-oriented listening socket |
| `https://developer.android.com/reference/java/nio/channels/CompletionHandler` | A handler for consuming the result of an asynchronous operation |
| `https://developer.android.com/reference/java/nio/channels/AsynchronousChannelGroup` | A grouping of asynchronous channels for the purpose of resource sharing |
|---|---|
[Lists asynchronous channels and their descriptions]

`https://developer.android.com/reference/java/nio/channels/AsynchronousChannel` are a
special type of channel capable of asynchronous I/O operations. Asynchronous
channels are non-blocking and define methods to initiate asynchronous
operations, returning a `https://developer.android.com/reference/java/util/concurrent/Future` representing the
pending result of each operation. The `Future` can be used to poll or
wait for the result of the operation. Asynchronous I/O operations can also
specify a `https://developer.android.com/reference/java/nio/channels/CompletionHandler` to invoke when the
operation completes. A completion handler is user provided code that is executed
to consume the result of I/O operation.

This package defines asynchronous-channel classes that are connected to
a stream-oriented connecting or listening socket, or a datagram-oriented socket.
It also defines the `https://developer.android.com/reference/java/nio/channels/AsynchronousFileChannel` class
for asynchronous reading, writing, and manipulating a file. As with the `https://developer.android.com/reference/java/nio/channels/FileChannel` it supports operations to truncate the file
to a specific size, force updates to the file to be written to the storage
device, or acquire locks on the whole file or on a specific region of the file.
Unlike the `FileChannel` it does not define methods for mapping a
region of the file directly into memory. Where memory mapped I/O is required,
then a `FileChannel` can be used.

Asynchronous channels are bound to an asynchronous channel group for the
purpose of resource sharing. A group has an associated `https://developer.android.com/reference/java/util/concurrent/ExecutorService` to which tasks are submitted to handle
I/O events and dispatch to completion handlers that consume the result of
asynchronous operations performed on channels in the group. The group can
optionally be specified when creating the channel or the channel can be bound
to a *default group* . Sophisticated users may wish to create their
own asynchronous channel groups or configure the `ExecutorService`
that will be used for the default group.

As with selectors, the implementation of asynchronous channels can be
replaced by "plugging in" an alternative definition or instance of the `https://developer.android.com/reference/java/nio/channels/spi/AsynchronousChannelProvider` class defined in the
`https://developer.android.com/reference/java/nio/channels/spi/package-summary` package. It is not expected that many
developers will actually make use of this facility; it is provided primarily
so that sophisticated users can take advantage of operating-system-specific
asynchronous I/O mechanisms when very high performance is required.

Unless otherwise noted, passing a `null` argument to a constructor
or method in any class or interface in this package will cause a `https://developer.android.com/reference/java/lang/NullPointerException` to be thrown.


## Interfaces

|---|---|
| [AsynchronousByteChannel](https://developer.android.com/reference/java/nio/channels/AsynchronousByteChannel) | An asynchronous channel that can read and write bytes. |
| [AsynchronousChannel](https://developer.android.com/reference/java/nio/channels/AsynchronousChannel) | A channel that supports asynchronous I/O operations. |
| [ByteChannel](https://developer.android.com/reference/java/nio/channels/ByteChannel) | A channel that can read and write bytes. |
| [Channel](https://developer.android.com/reference/java/nio/channels/Channel) | A nexus for I/O operations. |
| [CompletionHandler](https://developer.android.com/reference/java/nio/channels/CompletionHandler)\<V, A\> | A handler for consuming the result of an asynchronous I/O operation. |
| [GatheringByteChannel](https://developer.android.com/reference/java/nio/channels/GatheringByteChannel) | A channel that can write bytes from a sequence of buffers. |
| [InterruptibleChannel](https://developer.android.com/reference/java/nio/channels/InterruptibleChannel) | A channel that can be asynchronously closed and interrupted. |
| [MulticastChannel](https://developer.android.com/reference/java/nio/channels/MulticastChannel) | A network channel that supports Internet Protocol (IP) multicasting. |
| [NetworkChannel](https://developer.android.com/reference/java/nio/channels/NetworkChannel) | A channel to a network socket. |
| [ReadableByteChannel](https://developer.android.com/reference/java/nio/channels/ReadableByteChannel) | A channel that can read bytes. |
| [ScatteringByteChannel](https://developer.android.com/reference/java/nio/channels/ScatteringByteChannel) | A channel that can read bytes into a sequence of buffers. |
| [SeekableByteChannel](https://developer.android.com/reference/java/nio/channels/SeekableByteChannel) | A byte channel that maintains a current *position* and allows the position to be changed. |
| [WritableByteChannel](https://developer.android.com/reference/java/nio/channels/WritableByteChannel) | A channel that can write bytes. |

## Classes

|---|---|
| [AsynchronousChannelGroup](https://developer.android.com/reference/java/nio/channels/AsynchronousChannelGroup) | A grouping of asynchronous channels for the purpose of resource sharing. |
| [AsynchronousFileChannel](https://developer.android.com/reference/java/nio/channels/AsynchronousFileChannel) | An asynchronous channel for reading, writing, and manipulating a file. |
| [AsynchronousServerSocketChannel](https://developer.android.com/reference/java/nio/channels/AsynchronousServerSocketChannel) | An asynchronous channel for stream-oriented listening sockets. |
| [AsynchronousSocketChannel](https://developer.android.com/reference/java/nio/channels/AsynchronousSocketChannel) | An asynchronous channel for stream-oriented connecting sockets. |
| [Channels](https://developer.android.com/reference/java/nio/channels/Channels) | Utility methods for channels and streams. |
| [DatagramChannel](https://developer.android.com/reference/java/nio/channels/DatagramChannel) | A selectable channel for datagram-oriented sockets. |
| [FileChannel](https://developer.android.com/reference/java/nio/channels/FileChannel) | A channel for reading, writing, mapping, and manipulating a file. |
| [FileChannel.MapMode](https://developer.android.com/reference/java/nio/channels/FileChannel.MapMode) | A typesafe enumeration for file-mapping modes. |
| [FileLock](https://developer.android.com/reference/java/nio/channels/FileLock) | A token representing a lock on a region of a file. |
| [MembershipKey](https://developer.android.com/reference/java/nio/channels/MembershipKey) | A token representing the membership of an Internet Protocol (IP) multicast group. |
| [Pipe](https://developer.android.com/reference/java/nio/channels/Pipe) | A pair of channels that implements a unidirectional pipe. |
| [Pipe.SinkChannel](https://developer.android.com/reference/java/nio/channels/Pipe.SinkChannel) | A channel representing the writable end of a `https://developer.android.com/reference/java/nio/channels/Pipe`. |
| [Pipe.SourceChannel](https://developer.android.com/reference/java/nio/channels/Pipe.SourceChannel) | A channel representing the readable end of a `https://developer.android.com/reference/java/nio/channels/Pipe`. |
| [SelectableChannel](https://developer.android.com/reference/java/nio/channels/SelectableChannel) | A channel that can be multiplexed via a `https://developer.android.com/reference/java/nio/channels/Selector`. |
| [SelectionKey](https://developer.android.com/reference/java/nio/channels/SelectionKey) | A token representing the registration of a `https://developer.android.com/reference/java/nio/channels/SelectableChannel` with a `https://developer.android.com/reference/java/nio/channels/Selector`. |
| [Selector](https://developer.android.com/reference/java/nio/channels/Selector) | A multiplexor of `https://developer.android.com/reference/java/nio/channels/SelectableChannel` objects. |
| [ServerSocketChannel](https://developer.android.com/reference/java/nio/channels/ServerSocketChannel) | A selectable channel for stream-oriented listening sockets. |
| [SocketChannel](https://developer.android.com/reference/java/nio/channels/SocketChannel) | A selectable channel for stream-oriented connecting sockets. |

## Exceptions

|---|---|
| [AcceptPendingException](https://developer.android.com/reference/java/nio/channels/AcceptPendingException) | Unchecked exception thrown when an attempt is made to initiate an accept operation on a channel and a previous accept operation has not completed. |
| [AlreadyBoundException](https://developer.android.com/reference/java/nio/channels/AlreadyBoundException) | Unchecked exception thrown when an attempt is made to bind the socket a network oriented channel that is already bound. |
| [AlreadyConnectedException](https://developer.android.com/reference/java/nio/channels/AlreadyConnectedException) | Unchecked exception thrown when an attempt is made to connect a `https://developer.android.com/reference/java/nio/channels/SocketChannel` that is already connected. |
| [AsynchronousCloseException](https://developer.android.com/reference/java/nio/channels/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. |
| [CancelledKeyException](https://developer.android.com/reference/java/nio/channels/CancelledKeyException) | Unchecked exception thrown when an attempt is made to use a selection key that is no longer valid. |
| [ClosedByInterruptException](https://developer.android.com/reference/java/nio/channels/ClosedByInterruptException) | Checked exception received by a thread when another thread interrupts it while it is blocked in an I/O operation upon a channel. |
| [ClosedChannelException](https://developer.android.com/reference/java/nio/channels/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. |
| [ClosedSelectorException](https://developer.android.com/reference/java/nio/channels/ClosedSelectorException) | Unchecked exception thrown when an attempt is made to invoke an I/O operation upon a closed selector. |
| [ConnectionPendingException](https://developer.android.com/reference/java/nio/channels/ConnectionPendingException) | Unchecked exception thrown when an attempt is made to connect a `https://developer.android.com/reference/java/nio/channels/SocketChannel` for which a non-blocking connection operation is already in progress. |
| [FileLockInterruptionException](https://developer.android.com/reference/java/nio/channels/FileLockInterruptionException) | Checked exception received by a thread when another thread interrupts it while it is waiting to acquire a file lock. |
| [IllegalBlockingModeException](https://developer.android.com/reference/java/nio/channels/IllegalBlockingModeException) | Unchecked exception thrown when a blocking-mode-specific operation is invoked upon a channel in the incorrect blocking mode. |
| [IllegalChannelGroupException](https://developer.android.com/reference/java/nio/channels/IllegalChannelGroupException) | Unchecked exception thrown when an attempt is made to open a channel in a group that was not created by the same provider. |
| [IllegalSelectorException](https://developer.android.com/reference/java/nio/channels/IllegalSelectorException) | Unchecked exception thrown when an attempt is made to register a channel with a selector that was not created by the provider that created the channel. |
| [InterruptedByTimeoutException](https://developer.android.com/reference/java/nio/channels/InterruptedByTimeoutException) | Checked exception received by a thread when a timeout elapses before an asynchronous operation completes. |
| [NoConnectionPendingException](https://developer.android.com/reference/java/nio/channels/NoConnectionPendingException) | Unchecked exception thrown when the `https://developer.android.com/reference/java/nio/channels/SocketChannel#finishConnect()` method of a `https://developer.android.com/reference/java/nio/channels/SocketChannel` is invoked without first successfully invoking its `https://developer.android.com/reference/java/nio/channels/SocketChannel#connect(java.net.SocketAddress)` method. |
| [NonReadableChannelException](https://developer.android.com/reference/java/nio/channels/NonReadableChannelException) | Unchecked exception thrown when an attempt is made to read from a channel that was not originally opened for reading. |
| [NonWritableChannelException](https://developer.android.com/reference/java/nio/channels/NonWritableChannelException) | Unchecked exception thrown when an attempt is made to write to a channel that was not originally opened for writing. |
| [NotYetBoundException](https://developer.android.com/reference/java/nio/channels/NotYetBoundException) | Unchecked exception thrown when an attempt is made to invoke an I/O operation upon a server socket channel that is not yet bound. |
| [NotYetConnectedException](https://developer.android.com/reference/java/nio/channels/NotYetConnectedException) | Unchecked exception thrown when an attempt is made to invoke an I/O operation upon a socket channel that is not yet connected. |
| [OverlappingFileLockException](https://developer.android.com/reference/java/nio/channels/OverlappingFileLockException) | Unchecked exception thrown when an attempt is made to acquire a lock on a region of a file that overlaps a region already locked by the same Java virtual machine, or when another thread is already waiting to lock an overlapping region of the same file. |
| [ReadPendingException](https://developer.android.com/reference/java/nio/channels/ReadPendingException) | Unchecked exception thrown when an attempt is made to read from an asynchronous socket channel and a previous read has not completed. |
| [ShutdownChannelGroupException](https://developer.android.com/reference/java/nio/channels/ShutdownChannelGroupException) | Unchecked exception thrown when an attempt is made to construct a channel in a group that is shutdown or the completion handler for an I/O operation cannot be invoked because the channel group has terminated. |
| [UnresolvedAddressException](https://developer.android.com/reference/java/nio/channels/UnresolvedAddressException) | Unchecked exception thrown when an attempt is made to invoke a network operation upon an unresolved socket address. |
| [UnsupportedAddressTypeException](https://developer.android.com/reference/java/nio/channels/UnsupportedAddressTypeException) | Unchecked exception thrown when an attempt is made to bind or connect to a socket address of a type that is not supported. |
| [WritePendingException](https://developer.android.com/reference/java/nio/channels/WritePendingException) | Unchecked exception thrown when an attempt is made to write to an asynchronous socket channel and a previous write has not completed. |

-

  ## Interfaces

  - [AsynchronousByteChannel](https://developer.android.com/reference/java/nio/channels/AsynchronousByteChannel)
  - [AsynchronousChannel](https://developer.android.com/reference/java/nio/channels/AsynchronousChannel)
  - [ByteChannel](https://developer.android.com/reference/java/nio/channels/ByteChannel)
  - [Channel](https://developer.android.com/reference/java/nio/channels/Channel)
  - [CompletionHandler](https://developer.android.com/reference/java/nio/channels/CompletionHandler)
  - [GatheringByteChannel](https://developer.android.com/reference/java/nio/channels/GatheringByteChannel)
  - [InterruptibleChannel](https://developer.android.com/reference/java/nio/channels/InterruptibleChannel)
  - [MulticastChannel](https://developer.android.com/reference/java/nio/channels/MulticastChannel)
  - [NetworkChannel](https://developer.android.com/reference/java/nio/channels/NetworkChannel)
  - [ReadableByteChannel](https://developer.android.com/reference/java/nio/channels/ReadableByteChannel)
  - [ScatteringByteChannel](https://developer.android.com/reference/java/nio/channels/ScatteringByteChannel)
  - [SeekableByteChannel](https://developer.android.com/reference/java/nio/channels/SeekableByteChannel)
  - [WritableByteChannel](https://developer.android.com/reference/java/nio/channels/WritableByteChannel)
-

  ## Classes

  - [AsynchronousChannelGroup](https://developer.android.com/reference/java/nio/channels/AsynchronousChannelGroup)
  - [AsynchronousFileChannel](https://developer.android.com/reference/java/nio/channels/AsynchronousFileChannel)
  - [AsynchronousServerSocketChannel](https://developer.android.com/reference/java/nio/channels/AsynchronousServerSocketChannel)
  - [AsynchronousSocketChannel](https://developer.android.com/reference/java/nio/channels/AsynchronousSocketChannel)
  - [Channels](https://developer.android.com/reference/java/nio/channels/Channels)
  - [DatagramChannel](https://developer.android.com/reference/java/nio/channels/DatagramChannel)
  - [FileChannel](https://developer.android.com/reference/java/nio/channels/FileChannel)
  - [FileChannel.MapMode](https://developer.android.com/reference/java/nio/channels/FileChannel.MapMode)
  - [FileLock](https://developer.android.com/reference/java/nio/channels/FileLock)
  - [MembershipKey](https://developer.android.com/reference/java/nio/channels/MembershipKey)
  - [Pipe](https://developer.android.com/reference/java/nio/channels/Pipe)
  - [Pipe.SinkChannel](https://developer.android.com/reference/java/nio/channels/Pipe.SinkChannel)
  - [Pipe.SourceChannel](https://developer.android.com/reference/java/nio/channels/Pipe.SourceChannel)
  - [SelectableChannel](https://developer.android.com/reference/java/nio/channels/SelectableChannel)
  - [SelectionKey](https://developer.android.com/reference/java/nio/channels/SelectionKey)
  - [Selector](https://developer.android.com/reference/java/nio/channels/Selector)
  - [ServerSocketChannel](https://developer.android.com/reference/java/nio/channels/ServerSocketChannel)
  - [SocketChannel](https://developer.android.com/reference/java/nio/channels/SocketChannel)
-

  ## Exceptions

  - [AcceptPendingException](https://developer.android.com/reference/java/nio/channels/AcceptPendingException)
  - [AlreadyBoundException](https://developer.android.com/reference/java/nio/channels/AlreadyBoundException)
  - [AlreadyConnectedException](https://developer.android.com/reference/java/nio/channels/AlreadyConnectedException)
  - [AsynchronousCloseException](https://developer.android.com/reference/java/nio/channels/AsynchronousCloseException)
  - [CancelledKeyException](https://developer.android.com/reference/java/nio/channels/CancelledKeyException)
  - [ClosedByInterruptException](https://developer.android.com/reference/java/nio/channels/ClosedByInterruptException)
  - [ClosedChannelException](https://developer.android.com/reference/java/nio/channels/ClosedChannelException)
  - [ClosedSelectorException](https://developer.android.com/reference/java/nio/channels/ClosedSelectorException)
  - [ConnectionPendingException](https://developer.android.com/reference/java/nio/channels/ConnectionPendingException)
  - [FileLockInterruptionException](https://developer.android.com/reference/java/nio/channels/FileLockInterruptionException)
  - [IllegalBlockingModeException](https://developer.android.com/reference/java/nio/channels/IllegalBlockingModeException)
  - [IllegalChannelGroupException](https://developer.android.com/reference/java/nio/channels/IllegalChannelGroupException)
  - [IllegalSelectorException](https://developer.android.com/reference/java/nio/channels/IllegalSelectorException)
  - [InterruptedByTimeoutException](https://developer.android.com/reference/java/nio/channels/InterruptedByTimeoutException)
  - [NoConnectionPendingException](https://developer.android.com/reference/java/nio/channels/NoConnectionPendingException)
  - [NonReadableChannelException](https://developer.android.com/reference/java/nio/channels/NonReadableChannelException)
  - [NonWritableChannelException](https://developer.android.com/reference/java/nio/channels/NonWritableChannelException)
  - [NotYetBoundException](https://developer.android.com/reference/java/nio/channels/NotYetBoundException)
  - [NotYetConnectedException](https://developer.android.com/reference/java/nio/channels/NotYetConnectedException)
  - [OverlappingFileLockException](https://developer.android.com/reference/java/nio/channels/OverlappingFileLockException)
  - [ReadPendingException](https://developer.android.com/reference/java/nio/channels/ReadPendingException)
  - [ShutdownChannelGroupException](https://developer.android.com/reference/java/nio/channels/ShutdownChannelGroupException)
  - [UnresolvedAddressException](https://developer.android.com/reference/java/nio/channels/UnresolvedAddressException)
  - [UnsupportedAddressTypeException](https://developer.android.com/reference/java/nio/channels/UnsupportedAddressTypeException)
  - [WritePendingException](https://developer.android.com/reference/java/nio/channels/WritePendingException)