Package org.apache.commons.io.channels
Class FilterReadableByteChannel<C extends java.nio.channels.ReadableByteChannel>
- java.lang.Object
-
- org.apache.commons.io.channels.FilterChannel<C>
-
- org.apache.commons.io.channels.FilterReadableByteChannel<C>
-
- Type Parameters:
C- theReadableByteChanneltype.
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.nio.channels.Channel,java.nio.channels.ReadableByteChannel
public class FilterReadableByteChannel<C extends java.nio.channels.ReadableByteChannel> extends FilterChannel<C> implements java.nio.channels.ReadableByteChannel
AReadableByteChannelfilter which delegates to the wrappedReadableByteChannel.A
FilterReadableByteChannelwraps some other channel, which it uses as its basic source of data, possibly transforming the data along the way or providing additional functionality. The classFilterReadableByteChannelitself simply overrides methods ofReadableByteChannelwith versions that pass all requests to the wrapped channel. Subclasses ofFilterReadableByteChannelmay of course override any methods declared or inherited byFilterReadableByteChannel, and may also provide additional fields and methods.You construct s simple instance with the
channel constructorand more advanced instances through theFilterReadableByteChannel.Builder.- Since:
- 2.22.0
- See Also:
FilterInputStream,FilterOutputStream,FilterReader,FilterWritableByteChannel,ProxyInputStream,ProxyOutputStream,ProxyReader,ProxyWriter
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFilterReadableByteChannel.AbstractBuilder<F extends FilterReadableByteChannel<C>,C extends java.nio.channels.ReadableByteChannel,B extends FilterReadableByteChannel.AbstractBuilder<F,C,B>>Builds instances ofFilterReadableByteChannelfor subclasses.static classFilterReadableByteChannel.BuilderBuilds instances ofFilterByteChannel.
-
Constructor Summary
Constructors Constructor Description FilterReadableByteChannel(C channel)Constructs a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FilterReadableByteChannel.BuilderforReadableByteChannel()Creates a newFilterReadableByteChannel.Builder.intread(java.nio.ByteBuffer dst)-
Methods inherited from class org.apache.commons.io.channels.FilterChannel
close, forChannel, isOpen, unwrap
-
-
-
-
Constructor Detail
-
FilterReadableByteChannel
public FilterReadableByteChannel(C channel)
Constructs a new instance.- Parameters:
channel- The channel to wrap.
-
-
Method Detail
-
forReadableByteChannel
public static FilterReadableByteChannel.Builder forReadableByteChannel()
Creates a newFilterReadableByteChannel.Builder.- Returns:
- a new
FilterReadableByteChannel.Builder.
-
read
public int read(java.nio.ByteBuffer dst) throws java.io.IOException
- Specified by:
readin interfacejava.nio.channels.ReadableByteChannel- Throws:
java.io.IOException
-
-