Package org.apache.commons.io.channels

# Class FilterWritableByteChannel<C extends WritableByteChannel>

java.lang.Object
org.apache.commons.io.channels.FilterChannel<C>
org.apache.commons.io.channels.FilterWritableByteChannel<C>

Type Parameters:
  `C` - the `WritableByteChannel` type.

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`, `Channel`, `WritableByteChannel`

public class FilterWritableByteChannel<C extends WritableByteChannel> extends FilterChannel<C> implements WritableByteChannel
A `WritableByteChannel` filter which delegates to the wrapped `WritableByteChannel`.

A `FilterWritableByteChannel` 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 `FilterWritableByteChannel` itself simply overrides methods of `WritableByteChannel` with versions that pass all requests to the wrapped channel. Subclasses of `FilterWritableByteChannel` may of course override any methods declared or inherited by `WritableByteChannel`, and may also provide additional fields and methods.

You construct s simple instance with the `Channel constructor` and more advanced instances through the `FilterWritableByteChannel.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 class`
  `FilterWritableByteChannel.AbstractBuilder<F extends FilterWritableByteChannel<C>,C extends WritableByteChannel,B extends FilterWritableByteChannel.AbstractBuilder<F,C,B>>`
  Builds instances of `FilterWritableByteChannel` for subclasses.
  `static class`
  `FilterWritableByteChannel.Builder`
  Builds instances of `FilterByteChannel`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FilterWritableByteChannel(C channel)`
  Constructs a new instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static FilterWritableByteChannel.Builder`
  `forWritableByteChannel()`
  Creates a new `FilterWritableByteChannel.Builder`.
  `int`
  `write(ByteBuffer src)`

  ### Methods inherited from class org.apache.commons.io.channels.FilterChannel

  `close, forChannel, isOpen, unwrap`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface java.nio.channels.Channel

  `close, isOpen`

- ## Constructor Details

  - ### FilterWritableByteChannel

    public FilterWritableByteChannel(C channel)
    Constructs a new instance.
    Parameters:
      `channel` - The channel to wrap.

- ## Method Details

  - ### forWritableByteChannel

    public static FilterWritableByteChannel.Builder forWritableByteChannel()
    Creates a new `FilterWritableByteChannel.Builder`.
    Returns:
      a new `FilterWritableByteChannel.Builder`.

  - ### write

    public int write(ByteBuffer src) throws IOException
    Specified by:
      `write` in interface `WritableByteChannel`
    Throws:
      `IOException`