io.undertow.channels

## Class DetachableStreamSinkChannel

- java.lang.Object
- - io.undertow.channels.DetachableStreamSinkChannel

All Implemented Interfaces:
  Closeable, AutoCloseable, Channel, GatheringByteChannel, InterruptibleChannel, WritableByteChannel, org.xnio.channels.CloseableChannel, org.xnio.channels.Configurable, org.xnio.channels.StreamSinkChannel, org.xnio.channels.SuspendableWriteChannel

    public abstract class DetachableStreamSinkChannel
    extends Object
    implements org.xnio.channels.StreamSinkChannel

Stream sink channel. When this channel is considered detached it will no longer forward calls to the delegate

Author:
  Stuart Douglas

### Field Summary

Fields
`protected org.xnio.ChannelListener.SimpleSetter<DetachableStreamSinkChannel>` `closeSetter`
`protected org.xnio.channels.StreamSinkChannel` `delegate`
`protected org.xnio.ChannelListener.SimpleSetter<DetachableStreamSinkChannel>` `writeSetter`

### Fields inherited from interface org.xnio.channels.Configurable

`EMPTY`

### Constructor Summary

Constructors
Constructor and Description
`DetachableStreamSinkChannel(org.xnio.channels.StreamSinkChannel delegate)`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`void` `awaitWritable()`
`void` `awaitWritable(long time, TimeUnit timeUnit)`
`void` `close()`
`boolean` `flush()`
`org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSinkChannel>` `getCloseSetter()`
`org.xnio.XnioIoThread` `getIoThread()`
`<T> T` `getOption(org.xnio.Option<T> option)`
`org.xnio.XnioWorker` `getWorker()`
`org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSinkChannel>` `getWriteSetter()`
`org.xnio.XnioExecutor` `getWriteThread()`
`protected abstract boolean` `isFinished()`
`boolean` `isOpen()`
`boolean` `isWriteResumed()`
`void` `responseDone()`
`void` `resumeWrites()`
`<T> T` `setOption(org.xnio.Option<T> option, T value)`
`void` `shutdownWrites()`
`boolean` `supportsOption(org.xnio.Option<?> option)`
`void` `suspendWrites()`
`long` `transferFrom(FileChannel src, long position, long count)`
`long` `transferFrom(org.xnio.channels.StreamSourceChannel source, long count, ByteBuffer throughBuffer)`
`void` `wakeupWrites()`
`int` `write(ByteBuffer src)`
`long` `write(ByteBuffer[] srcs)`
`long` `write(ByteBuffer[] srcs, int offset, int length)`
`int` `writeFinal(ByteBuffer src)`
`long` `writeFinal(ByteBuffer[] srcs)`
`long` `writeFinal(ByteBuffer[] srcs, int offset, int length)`

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

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

### Field Detail

#### delegate

    protected final org.xnio.channels.StreamSinkChannel delegate

#### writeSetter

    protected org.xnio.ChannelListener.SimpleSetter<DetachableStreamSinkChannel> writeSetter

#### closeSetter

    protected org.xnio.ChannelListener.SimpleSetter<DetachableStreamSinkChannel> closeSetter

### Constructor Detail

#### DetachableStreamSinkChannel

    public DetachableStreamSinkChannel(org.xnio.channels.StreamSinkChannel delegate)

### Method Detail

#### isFinished

    protected abstract boolean isFinished()

#### suspendWrites

    public void suspendWrites()

Specified by:
  `suspendWrites` in interface `org.xnio.channels.SuspendableWriteChannel`

#### isWriteResumed

    public boolean isWriteResumed()

Specified by:
  `isWriteResumed` in interface `org.xnio.channels.SuspendableWriteChannel`

#### shutdownWrites

    public void shutdownWrites()
                        throws IOException

Specified by:
  `shutdownWrites` in interface `org.xnio.channels.SuspendableWriteChannel`
Throws:
  `IOException`

#### awaitWritable

    public void awaitWritable()
                       throws IOException

Specified by:
  `awaitWritable` in interface `org.xnio.channels.SuspendableWriteChannel`
Throws:
  `IOException`

#### awaitWritable

    public void awaitWritable(long time,
                              TimeUnit timeUnit)
                       throws IOException

Specified by:
  `awaitWritable` in interface `org.xnio.channels.SuspendableWriteChannel`
Throws:
  `IOException`

#### getWriteThread

    public org.xnio.XnioExecutor getWriteThread()

Specified by:
  `getWriteThread` in interface `org.xnio.channels.SuspendableWriteChannel`

#### isOpen

    public boolean isOpen()

Specified by:
  `isOpen` in interface `Channel`
Specified by:
  `isOpen` in interface `org.xnio.channels.SuspendableWriteChannel`

#### close

    public void close()
               throws IOException

Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Channel`
Specified by:
  `close` in interface `InterruptibleChannel`
Specified by:
  `close` in interface `org.xnio.channels.CloseableChannel`
Specified by:
  `close` in interface `org.xnio.channels.SuspendableWriteChannel`
Throws:
  `IOException`

#### flush

    public boolean flush()
                  throws IOException

Specified by:
  `flush` in interface `org.xnio.channels.SuspendableWriteChannel`
Throws:
  `IOException`

#### transferFrom

    public long transferFrom(FileChannel src,
                             long position,
                             long count)
                      throws IOException

Specified by:
  `transferFrom` in interface `org.xnio.channels.StreamSinkChannel`
Throws:
  `IOException`

#### transferFrom

    public long transferFrom(org.xnio.channels.StreamSourceChannel source,
                             long count,
                             ByteBuffer throughBuffer)
                      throws IOException

Specified by:
  `transferFrom` in interface `org.xnio.channels.StreamSinkChannel`
Throws:
  `IOException`

#### getWriteSetter

    public org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSinkChannel> getWriteSetter()

Specified by:
  `getWriteSetter` in interface `org.xnio.channels.StreamSinkChannel`
Specified by:
  `getWriteSetter` in interface `org.xnio.channels.SuspendableWriteChannel`

#### getCloseSetter

    public org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSinkChannel> getCloseSetter()

Specified by:
  `getCloseSetter` in interface `org.xnio.channels.CloseableChannel`
Specified by:
  `getCloseSetter` in interface `org.xnio.channels.StreamSinkChannel`
Specified by:
  `getCloseSetter` in interface `org.xnio.channels.SuspendableWriteChannel`

#### getWorker

    public org.xnio.XnioWorker getWorker()

Specified by:
  `getWorker` in interface `org.xnio.channels.CloseableChannel`

#### getIoThread

    public org.xnio.XnioIoThread getIoThread()

Specified by:
  `getIoThread` in interface `org.xnio.channels.CloseableChannel`

#### write

    public long write(ByteBuffer[] srcs,
                      int offset,
                      int length)
               throws IOException

Specified by:
  `write` in interface `GatheringByteChannel`
Throws:
  `IOException`

#### write

    public long write(ByteBuffer[] srcs)
               throws IOException

Specified by:
  `write` in interface `GatheringByteChannel`
Throws:
  `IOException`

#### writeFinal

    public int writeFinal(ByteBuffer src)
                   throws IOException

Specified by:
  `writeFinal` in interface `org.xnio.channels.StreamSinkChannel`
Throws:
  `IOException`

#### writeFinal

    public long writeFinal(ByteBuffer[] srcs,
                           int offset,
                           int length)
                    throws IOException

Specified by:
  `writeFinal` in interface `org.xnio.channels.StreamSinkChannel`
Throws:
  `IOException`

#### writeFinal

    public long writeFinal(ByteBuffer[] srcs)
                    throws IOException

Specified by:
  `writeFinal` in interface `org.xnio.channels.StreamSinkChannel`
Throws:
  `IOException`

#### supportsOption

    public boolean supportsOption(org.xnio.Option<?> option)

Specified by:
  `supportsOption` in interface `org.xnio.channels.Configurable`

#### getOption

    public <T> T getOption(org.xnio.Option<T> option)
                    throws IOException

Specified by:
  `getOption` in interface `org.xnio.channels.Configurable`
Throws:
  `IOException`

#### setOption

    public <T> T setOption(org.xnio.Option<T> option,
                           T value)
                    throws IllegalArgumentException,
                           IOException

Specified by:
  `setOption` in interface `org.xnio.channels.Configurable`
Throws:
  `IllegalArgumentException`
  `IOException`

#### write

    public int write(ByteBuffer src)
              throws IOException

Specified by:
  `write` in interface `WritableByteChannel`
Throws:
  `IOException`

#### resumeWrites

    public void resumeWrites()

Specified by:
  `resumeWrites` in interface `org.xnio.channels.SuspendableWriteChannel`

#### wakeupWrites

    public void wakeupWrites()

Specified by:
  `wakeupWrites` in interface `org.xnio.channels.SuspendableWriteChannel`

#### responseDone

    public void responseDone()