public class FilterSeekableByteChannel
extends java.lang.Object
implements java.nio.channels.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 java.nio.channels.SeekableByteChannel |
delegate
The underlying
SeekableByteChannel instance. |
Constructor and Description |
---|
FilterSeekableByteChannel(java.nio.channels.SeekableByteChannel delegate)
Construct a
FilterSeekableByteChannel based on
the specified base channel. |
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
isOpen() |
long |
position() |
java.nio.channels.SeekableByteChannel |
position(long newPosition) |
int |
read(java.nio.ByteBuffer dst) |
long |
size() |
java.nio.channels.SeekableByteChannel |
truncate(long size) |
int |
write(java.nio.ByteBuffer src) |
protected final java.nio.channels.SeekableByteChannel delegate
SeekableByteChannel
instance.public FilterSeekableByteChannel(java.nio.channels.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 boolean isOpen()
isOpen
in interface java.nio.channels.Channel
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface java.nio.channels.Channel
java.io.IOException
public int read(java.nio.ByteBuffer dst) throws java.io.IOException
read
in interface java.nio.channels.ReadableByteChannel
read
in interface java.nio.channels.SeekableByteChannel
java.io.IOException
public int write(java.nio.ByteBuffer src) throws java.io.IOException
write
in interface java.nio.channels.SeekableByteChannel
write
in interface java.nio.channels.WritableByteChannel
java.io.IOException
public long position() throws java.io.IOException
position
in interface java.nio.channels.SeekableByteChannel
java.io.IOException
public java.nio.channels.SeekableByteChannel position(long newPosition) throws java.io.IOException
position
in interface java.nio.channels.SeekableByteChannel
java.io.IOException
public long size() throws java.io.IOException
size
in interface java.nio.channels.SeekableByteChannel
java.io.IOException
public java.nio.channels.SeekableByteChannel truncate(long size) throws java.io.IOException
truncate
in interface java.nio.channels.SeekableByteChannel
java.io.IOException
Copyright © 2000–2019 The Apache Software Foundation. All rights reserved.