public class FilterSeekableByteChannel extends Object implements SeekableByteChannel
FilterSeekableByteChannel
contains another
SeekableByteChannel
, which it uses as its basic
source of data, possibly transforming the data along the
way or providing additional functionality.Modifier and Type | Field and Description |
---|---|
protected SeekableByteChannel |
delegate
The underlying
SeekableByteChannel instance. |
Constructor and Description |
---|
FilterSeekableByteChannel(SeekableByteChannel delegate)
Construct a
FilterSeekableByteChannel based on
the specified base channel. |
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
isOpen() |
long |
position() |
SeekableByteChannel |
position(long newPosition) |
int |
read(ByteBuffer dst) |
long |
size() |
SeekableByteChannel |
truncate(long size) |
int |
write(ByteBuffer src) |
protected final SeekableByteChannel delegate
SeekableByteChannel
instance.public FilterSeekableByteChannel(SeekableByteChannel delegate)
FilterSeekableByteChannel
based on
the specified base channel.
Note that base channel is closed if this channel is closed.
delegate
- specified base channel.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in interface Channel
IOException
public int read(ByteBuffer dst) throws IOException
read
in interface ReadableByteChannel
read
in interface SeekableByteChannel
IOException
public int write(ByteBuffer src) throws IOException
write
in interface SeekableByteChannel
write
in interface WritableByteChannel
IOException
public long position() throws IOException
position
in interface SeekableByteChannel
IOException
public SeekableByteChannel position(long newPosition) throws IOException
position
in interface SeekableByteChannel
IOException
public long size() throws IOException
size
in interface SeekableByteChannel
IOException
public SeekableByteChannel truncate(long size) throws IOException
truncate
in interface SeekableByteChannel
IOException
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.