package is at the heart of the NIO API.
A channel is a communication channel for
transferring bytes from or to a
java.nio.ByteBuffer. Channels serve a similar
purpose to the
OutputStream classes of the
java.io package, but are completely unrelated to
those classes, and provide important features not available with the
java.io API. The
defines methods that bridge the
java.nio.channels APIs, by returning channels
streams and streams based on channels.
interface simply defines methods
for testing whether a channel is open and for closing a channel. The
other interfaces in the package extend
read( ) and
methods for reading bytes from the channel into one or more byte
buffers and for writing bytes from one or more byte buffers to the
FileChannel class defines an channel-based API
for reading and writing from files (and also provides other important
file functionality such as file locking and memory mapping that is
not available through the
DatagramChannel are channels for communication
over a network, and
Pipe defines two inner classes
that use the channel abstraction for communication between threads.
The network and pipe channels are all subclasses of the
SelectableChannel class, and may be put into
nonblocking mode, in which calls to
read( ) and
write( ) return immediately, even ...