A channel that can read and write bytes.
A nexus for I/O operations.
A channel that can read bytes.
A byte channel that maintains a current position and allows the position to be changed.
A channel that can write bytes.
Utility methods for channels and streams.
A channel for reading, writing, mapping, and manipulating a file.
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.
Checked exception received by a thread when another thread interrupts it while it is blocked in an I/O operation upon a channel.
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.
Unchecked exception thrown when a blocking-mode-specific operation is invoked upon a channel in the incorrect blocking mode.
Unchecked exception thrown when an attempt is made to read from a channel that was not originally opened for reading.
Unchecked exception thrown when an attempt is made to write to a channel that was not originally opened for writing.
A nexus for I/O operations
Can read into a buffer
Can write from a buffer
Can read/write to/from a buffer
ByteChannelconnected to an entity that contains a variable-length sequence of bytes
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
channels are either open or closed, and they are both asynchronously
closeable and interruptible.
Channel interface is extended by several
ReadableByteChannel interface specifies a
read method that reads bytes
from the channel into a buffer; similarly, the
WritableByteChannel interface specifies a
write method that writes bytes
from a buffer to the channel. The
interface unifies these two interfaces for the common case of channels that can
both read and write bytes. The
interface extends the
ByteChannel interface with methods to
modify the channel's
current position, and its
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.
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.
Unless otherwise noted, passing a null argument to a constructor
or method in any class or interface in this package will cause a
NullPointerException to be thrown.
Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. Use of this specification is subject to license terms.