Package org.apache.commons.io.channels
Class FilterWritableByteChannel<C extends java.nio.channels.WritableByteChannel>
- java.lang.Object
-
- org.apache.commons.io.channels.FilterChannel<C>
-
- org.apache.commons.io.channels.FilterWritableByteChannel<C>
-
- Type Parameters:
C- theWritableByteChanneltype.
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.nio.channels.Channel,java.nio.channels.WritableByteChannel
public class FilterWritableByteChannel<C extends java.nio.channels.WritableByteChannel> extends FilterChannel<C> implements java.nio.channels.WritableByteChannel
AWritableByteChannelfilter which delegates to the wrappedWritableByteChannel.A
FilterWritableByteChannelwraps some other channel, which it uses as its basic source of data, possibly transforming the data along the way or providing additional functionality. The classFilterWritableByteChannelitself simply overrides methods ofWritableByteChannelwith versions that pass all requests to the wrapped channel. Subclasses ofFilterWritableByteChannelmay of course override any methods declared or inherited byWritableByteChannel, and may also provide additional fields and methods.You construct s simple instance with the
Channel constructorand more advanced instances through theFilterWritableByteChannel.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 classFilterWritableByteChannel.AbstractBuilder<F extends FilterWritableByteChannel<C>,C extends java.nio.channels.WritableByteChannel,B extends FilterWritableByteChannel.AbstractBuilder<F,C,B>>Builds instances ofFilterWritableByteChannelfor subclasses.static classFilterWritableByteChannel.BuilderBuilds instances ofFilterByteChannel.
-
Constructor Summary
Constructors Constructor Description FilterWritableByteChannel(C channel)Constructs a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FilterWritableByteChannel.BuilderforWritableByteChannel()Creates a newFilterWritableByteChannel.Builder.intwrite(java.nio.ByteBuffer src)-
Methods inherited from class org.apache.commons.io.channels.FilterChannel
close, forChannel, isOpen, unwrap
-
-
-
-
Constructor Detail
-
FilterWritableByteChannel
public FilterWritableByteChannel(C channel)
Constructs a new instance.- Parameters:
channel- The channel to wrap.
-
-
Method Detail
-
forWritableByteChannel
public static FilterWritableByteChannel.Builder forWritableByteChannel()
Creates a newFilterWritableByteChannel.Builder.- Returns:
- a new
FilterWritableByteChannel.Builder.
-
write
public int write(java.nio.ByteBuffer src) throws java.io.IOException
- Specified by:
writein interfacejava.nio.channels.WritableByteChannel- Throws:
java.io.IOException
-
-