public class ByteBufferSeekableSource extends Object implements SeekableSource
| Constructor and Description |
|---|
ByteBufferSeekableSource(byte[] source)
Constructs a new ByteArraySeekableSource.
|
ByteBufferSeekableSource(ByteBuffer bb)
Constructs a new ByteArraySeekableSource.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
int |
read(ByteBuffer dest)
Reads up to
Buffer.remaining() bytes from the source,
returning the number of bytes read, or -1 if no bytes were read
and EOF was reached. |
void |
seek(long pos)
Sets the position for the next
SeekableSource.read(ByteBuffer). |
String |
toString()
Returns a debug
String. |
public ByteBufferSeekableSource(byte[] source)
public ByteBufferSeekableSource(ByteBuffer bb)
public void seek(long pos)
throws IOException
SeekableSourceSeekableSource.read(ByteBuffer).seek in interface SeekableSourceIOExceptionpublic int read(ByteBuffer dest) throws IOException
SeekableSourceBuffer.remaining() bytes from the source,
returning the number of bytes read, or -1 if no bytes were read
and EOF was reached.read in interface SeekableSourceIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOException