Channels and Buffers are the central objects in NIO, and are used for just about
every I/O operation.
Channels are analogous to streams in the original I/O package. All data that goes
anywhere (or comes from anywhere) must pass through a Channel object. A Buffer
is essentially a container object. All data that is sent to a channel must first be placed in
a buffer; likewise, any data that is read from a channel is read into a buffer.
List of available buffers for primitives (ByteBuffer, CharBuffer, ShortBuffer, IntBuffer, LongBuffer, FloatBuffer, DoubleBuffer).
Channels differ from streams in that they are bi-directional. Whereas streams only go in
one direction (a stream must be a subclass of either InputStream or
OutputStream), a Channel can be opened for reading, for writing, or for both.
Three values can be used to specify the state of a buffer at any given moment in time: