Represents a chunk of data cut out of a larger data volume.
Buffer is characterized by offset at which it belongs to the
larger data volume, and length.
The internal data array always starts at 0 and ends at (length -1).
Its indexing has nothing to do with offset.
public Buffer(byte buf,
buf - the data buffer (always starts at 0)
length - length of the data in the buffer
offset - offset of the data the buffer was read from.
public byte getBuffer()
public int getLength()
public long getOffset()
Returns offset of the data the buffer was read from.
Value -1 indicates that offset is not supported.
For instance, this will happen if the buffer represents
a chunk of data read off the data channel in the stream