ByteBuffers
as the underlying data format. Only the initial producer and
final consumer have to be changed.
For example, the Zip/Jar code supports InputStreams
.
To make the Zip code use MappedByteBuffers
as
the underlying data structure, it can create a class of InputStream that wraps
the ByteBuffer, and implements the ByteBuffered interface. A co-operating class
several layers away can ask the InputStream if it is an instance of ByteBuffered,
then call the getByteBuffer()
method.
Modifier and Type | Method and Description |
---|---|
public ByteBuffer | Returns: TheByteBuffer , if this particular instance has one,
or null otherwise.Returns the |
getByteBuffer | back to summary |
---|---|
public ByteBuffer getByteBuffer() throws IOException Returns the
|