Reads a sequence of bytes from this channel into the given buffer.
Bytes are read starting at this channel's current position, and
then the position is updated with the number of bytes actually read.
Otherwise this method behaves exactly as specified in the ReadableByteChannel
interface.
-1
if the
channel has reached end-of-stream
Writes a sequence of bytes to this channel from the given buffer.
Bytes are written starting at this channel's current position, unless
the channel is connected to an entity such as a file that is opened with
the APPEND
option, in
which case the position is first advanced to the end. The entity to which
the channel is connected is grown, if necessary, to accommodate the
written bytes, and then the position is updated with the number of bytes
actually written. Otherwise this method behaves exactly as specified by
the WritableByteChannel
interface.
Diagram: FileChannel