Package org.apache.commons.io.channels
Class FilterByteChannel<C extends ByteChannel>
java.lang.Object
org.apache.commons.io.channels.FilterChannel<C>
org.apache.commons.io.channels.FilterByteChannel<C>
- Type Parameters:
C- theByteChanneltype.
- All Implemented Interfaces:
Closeable,AutoCloseable,ByteChannel,Channel,ReadableByteChannel,WritableByteChannel
- Direct Known Subclasses:
FilterSeekableByteChannel
public class FilterByteChannel<C extends ByteChannel>
extends FilterChannel<C>
implements ByteChannel
A
ByteChannel filter which delegates to the wrapped ByteChannel.
A FilterByteChannel 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 FilterByteChannel itself simply overrides methods of ByteChannel with versions that pass all requests to
the wrapped channel. Subclasses of FilterByteChannel may of course override any methods declared or inherited by FilterByteChannel, and may
also provide additional fields and methods.
You construct s simple instance with the channel constructor and more advanced instances through the
FilterByteChannel.Builder.
- Since:
- 2.22.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFilterByteChannel.AbstractBuilder<F extends FilterByteChannel<C>,C extends ByteChannel, B extends FilterByteChannel.AbstractBuilder<F, C, B>> Builds instances ofFilterByteChannelfor subclasses.static classBuilds instances ofFilterByteChannel. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FilterByteChannel.BuilderCreates a newFilterByteChannel.Builder.intread(ByteBuffer dst) intwrite(ByteBuffer src) Methods inherited from class org.apache.commons.io.channels.FilterChannel
close, forChannel, isOpen, unwrap
-
Constructor Details
-
FilterByteChannel
Constructs a new instance.- Parameters:
byteChannel- The channel to wrap.
-
-
Method Details
-
forByteChannel
Creates a newFilterByteChannel.Builder.- Returns:
- a new
FilterByteChannel.Builder.
-
read
- Specified by:
readin interfaceReadableByteChannel- Throws:
IOException
-
write
- Specified by:
writein interfaceWritableByteChannel- Throws:
IOException
-