Package org.apache.commons.io.channels
Class FilterSeekableByteChannel<C extends SeekableByteChannel>
java.lang.Object
org.apache.commons.io.channels.FilterChannel<C>
org.apache.commons.io.channels.FilterByteChannel<C>
org.apache.commons.io.channels.FilterSeekableByteChannel<C>
- Type Parameters:
C- theSeekableByteChanneltype.
- All Implemented Interfaces:
Closeable,AutoCloseable,ByteChannel,Channel,ReadableByteChannel,SeekableByteChannel,WritableByteChannel
public class FilterSeekableByteChannel<C extends SeekableByteChannel>
extends FilterByteChannel<C>
implements SeekableByteChannel
A
SeekableByteChannel filter which delegates to the wrapped SeekableByteChannel.
A FilterSeekableByteChannel wraps some other channel, which it uses as its basic source of data, possibly transforming the data along the way or
providing additional functionality. The class FilterSeekableByteChannel itself simply overrides methods of SeekableByteChannel with versions
that pass all requests to the wrapped channel. Subclasses of FilterSeekableByteChannel may of course override any methods declared or inherited by
FilterSeekableByteChannel, and may also provide additional fields and methods.
You construct s simple instance with the Channel constructor and more
advanced instances through the FilterSeekableByteChannel.Builder.
- Since:
- 2.22.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFilterSeekableByteChannel.AbstractBuilder<F extends FilterSeekableByteChannel<C>,C extends SeekableByteChannel, B extends FilterSeekableByteChannel.AbstractBuilder<F, C, B>> Builds instances ofFilterSeekableByteChannelfor subclasses.static classBuilds instances ofFilterSeekableByteChannel. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a newFilterSeekableByteChannel.Builder.longposition()position(long newPosition) longsize()truncate(long size) Methods inherited from class org.apache.commons.io.channels.FilterByteChannel
forByteChannel, read, writeMethods inherited from class org.apache.commons.io.channels.FilterChannel
close, forChannel, isOpen, unwrapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.nio.channels.SeekableByteChannel
read, write
-
Constructor Details
-
FilterSeekableByteChannel
Constructs a new instance.- Parameters:
channel- The channel to wrap.
-
-
Method Details
-
forSeekableByteChannel
Creates a newFilterSeekableByteChannel.Builder.- Returns:
- a new
FilterSeekableByteChannel.Builder.
-
position
- Specified by:
positionin interfaceSeekableByteChannel- Throws:
IOException
-
position
- Specified by:
positionin interfaceSeekableByteChannel- Throws:
IOException
-
size
- Specified by:
sizein interfaceSeekableByteChannel- Throws:
IOException
-
truncate
- Specified by:
truncatein interfaceSeekableByteChannel- Throws:
IOException
-