public abstract class DecoratingSeekableChannel extends AbstractSeekableChannel
Note that sub-classes of this class may implement their own virtual file pointer. Thus, if you would like to use the decorated seekable byte channel again after you have finished using this seekable byte channel, then you should not assume a particular position of the file pointer of the decorated seekable byte channel.
| Modifier and Type | Field and Description |
|---|---|
protected SeekableByteChannel |
channel
The nullable decorated seekable byte channel.
|
| Modifier | Constructor and Description |
|---|---|
protected |
DecoratingSeekableChannel() |
protected |
DecoratingSeekableChannel(SeekableByteChannel channel) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
isOpen() |
long |
position() |
SeekableByteChannel |
position(long newPosition) |
int |
read(ByteBuffer dst) |
long |
size() |
String |
toString()
Returns a string representation of this object for debugging and logging
purposes.
|
SeekableByteChannel |
truncate(long size) |
int |
write(ByteBuffer src) |
checkOpen@Nullable @WillCloseWhenClosed protected SeekableByteChannel channel
protected DecoratingSeekableChannel()
protected DecoratingSeekableChannel(@WillCloseWhenClosed SeekableByteChannel channel)
@DischargesObligation
public void close()
throws IOException
IOExceptionpublic boolean isOpen()
public long position()
throws IOException
IOExceptionpublic SeekableByteChannel position(long newPosition) throws IOException
IOExceptionpublic int read(ByteBuffer dst) throws IOException
IOExceptionpublic long size()
throws IOException
IOExceptionpublic String toString()
public SeekableByteChannel truncate(long size) throws IOException
IOExceptionpublic int write(ByteBuffer src) throws IOException
IOExceptionCopyright © 2012–2014 Schlichtherle IT Services. All rights reserved.