@NotThreadSafe @CleanupObligation public class SeekableByteBufferChannel extends Object implements SeekableByteChannel
| Constructor and Description |
|---|
SeekableByteBufferChannel(ByteBuffer buffer)
Constructs a new seekable byte buffer channel with a
duplicate of the given byte buffer
as its initial byte buffer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
A no-op.
|
ByteBuffer |
getByteBuffer()
Returns a duplicate of the backing
byte buffer.
|
boolean |
isOpen()
Returns always
true. |
long |
position() |
SeekableByteBufferChannel |
position(long newPosition) |
int |
read(ByteBuffer dst) |
long |
size() |
SeekableByteBufferChannel |
truncate(long newSize) |
int |
write(ByteBuffer src) |
@CreatesObligation public SeekableByteBufferChannel(ByteBuffer buffer)
buffer - the initial byte buffer to read or write.IllegalArgumentException - if buffer is not read-only and
supports no array access for
resizing it.@DischargesObligation
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface ChannelIOExceptionpublic ByteBuffer getByteBuffer()
public boolean isOpen()
true.public final long position()
throws IOException
position in interface SeekableByteChannelIOExceptionpublic final SeekableByteBufferChannel position(long newPosition) throws IOException
position in interface SeekableByteChannelIOExceptionpublic final int read(ByteBuffer dst) throws IOException
read in interface ReadableByteChannelread in interface SeekableByteChannelIOExceptionpublic final long size()
throws IOException
size in interface SeekableByteChannelIOExceptionpublic final SeekableByteBufferChannel truncate(long newSize) throws IOException
truncate in interface SeekableByteChannelIOExceptionpublic final int write(ByteBuffer src) throws IOException
write in interface SeekableByteChannelwrite in interface WritableByteChannelIOExceptionCopyright © 2005-2013 Schlichtherle IT Services. All Rights Reserved.