Top Description Methods
sun.nio

public Interface ByteBuffered

Imports
java.nio.ByteBuffer, java.io.IOException

This is an interface to adapt existing APIs to use 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.

Method Summary

Modifier and TypeMethod and Description
public ByteBuffer

Returns:

The ByteBuffer, if this particular instance has one, or null otherwise.
getByteBuffer
()

Returns the ByteBuffer behind this object, if this particular instance has one.

Method Detail

getByteBufferback to summary
public ByteBuffer getByteBuffer() throws IOException

Returns the ByteBuffer behind this object, if this particular instance has one. An implementation of getByteBuffer() is allowed to return null for any reason.

Returns:ByteBuffer

The ByteBuffer, if this particular instance has one, or null otherwise.

Exceptions
IOException:
If the ByteBuffer is no longer valid.
Since
1.5