io.undertow.channels

## Class DetachableStreamSourceChannel

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

All Implemented Interfaces:
  Closeable, AutoCloseable, Channel, InterruptibleChannel, ReadableByteChannel, ScatteringByteChannel, org.xnio.channels.CloseableChannel, org.xnio.channels.Configurable, org.xnio.channels.StreamSourceChannel, org.xnio.channels.SuspendableReadChannel

    public abstract class DetachableStreamSourceChannel
    extends Object
    implements org.xnio.channels.StreamSourceChannel

A stream source channel that can be marked as detached. Once this is marked as detached then calls will no longer be forwarded to the delegate.

Author:
  Stuart Douglas

### Field Summary

Fields
`protected org.xnio.ChannelListener.SimpleSetter<DetachableStreamSourceChannel>` `closeSetter`
`protected org.xnio.channels.StreamSourceChannel` `delegate`
`protected org.xnio.ChannelListener.SimpleSetter<DetachableStreamSourceChannel>` `readSetter`

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

`EMPTY`

### Constructor Summary

Constructors
Constructor and Description
`DetachableStreamSourceChannel(org.xnio.channels.StreamSourceChannel delegate)`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`void` `awaitReadable()`
`void` `awaitReadable(long time, TimeUnit timeUnit)`
`void` `close()`
`org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSourceChannel>` `getCloseSetter()`
`org.xnio.XnioIoThread` `getIoThread()`
`<T> T` `getOption(org.xnio.Option<T> option)`
`org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSourceChannel>` `getReadSetter()`
`org.xnio.XnioExecutor` `getReadThread()`
`org.xnio.XnioWorker` `getWorker()`
`protected abstract boolean` `isFinished()`
`boolean` `isOpen()`
`boolean` `isReadResumed()`
`int` `read(ByteBuffer dst)`
`long` `read(ByteBuffer[] dsts)`
`long` `read(ByteBuffer[] dsts, int offset, int length)`
`void` `resumeReads()`
`<T> T` `setOption(org.xnio.Option<T> option, T value)`
`void` `shutdownReads()`
`boolean` `supportsOption(org.xnio.Option<?> option)`
`void` `suspendReads()`
`long` `transferTo(long count, ByteBuffer throughBuffer, org.xnio.channels.StreamSinkChannel target)`
`long` `transferTo(long position, long count, FileChannel target)`
`void` `wakeupReads()`

### 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.StreamSourceChannel delegate

#### readSetter

    protected org.xnio.ChannelListener.SimpleSetter<DetachableStreamSourceChannel> readSetter

#### closeSetter

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

### Constructor Detail

#### DetachableStreamSourceChannel

    public DetachableStreamSourceChannel(org.xnio.channels.StreamSourceChannel delegate)

### Method Detail

#### isFinished

    protected abstract boolean isFinished()

#### resumeReads

    public void resumeReads()

Specified by:
  `resumeReads` in interface `org.xnio.channels.SuspendableReadChannel`

#### transferTo

    public long transferTo(long position,
                           long count,
                           FileChannel target)
                    throws IOException

Specified by:
  `transferTo` in interface `org.xnio.channels.StreamSourceChannel`
Throws:
  `IOException`

#### awaitReadable

    public void awaitReadable()
                       throws IOException

Specified by:
  `awaitReadable` in interface `org.xnio.channels.SuspendableReadChannel`
Throws:
  `IOException`

#### suspendReads

    public void suspendReads()

Specified by:
  `suspendReads` in interface `org.xnio.channels.SuspendableReadChannel`

#### transferTo

    public long transferTo(long count,
                           ByteBuffer throughBuffer,
                           org.xnio.channels.StreamSinkChannel target)
                    throws IOException

Specified by:
  `transferTo` in interface `org.xnio.channels.StreamSourceChannel`
Throws:
  `IOException`

#### getWorker

    public org.xnio.XnioWorker getWorker()

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

#### isReadResumed

    public boolean isReadResumed()

Specified by:
  `isReadResumed` in interface `org.xnio.channels.SuspendableReadChannel`

#### 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`

#### supportsOption

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

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

#### shutdownReads

    public void shutdownReads()
                       throws IOException

Specified by:
  `shutdownReads` in interface `org.xnio.channels.SuspendableReadChannel`
Throws:
  `IOException`

#### getReadSetter

    public org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSourceChannel> getReadSetter()

Specified by:
  `getReadSetter` in interface `org.xnio.channels.StreamSourceChannel`
Specified by:
  `getReadSetter` in interface `org.xnio.channels.SuspendableReadChannel`

#### isOpen

    public boolean isOpen()

Specified by:
  `isOpen` in interface `Channel`

#### read

    public long read(ByteBuffer[] dsts)
              throws IOException

Specified by:
  `read` in interface `ScatteringByteChannel`
Throws:
  `IOException`

#### read

    public long read(ByteBuffer[] dsts,
                     int offset,
                     int length)
              throws IOException

Specified by:
  `read` in interface `ScatteringByteChannel`
Throws:
  `IOException`

#### wakeupReads

    public void wakeupReads()

Specified by:
  `wakeupReads` in interface `org.xnio.channels.SuspendableReadChannel`

#### getReadThread

    public org.xnio.XnioExecutor getReadThread()

Specified by:
  `getReadThread` in interface `org.xnio.channels.SuspendableReadChannel`

#### awaitReadable

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

Specified by:
  `awaitReadable` in interface `org.xnio.channels.SuspendableReadChannel`
Throws:
  `IOException`

#### getCloseSetter

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

Specified by:
  `getCloseSetter` in interface `org.xnio.channels.CloseableChannel`
Specified by:
  `getCloseSetter` in interface `org.xnio.channels.StreamSourceChannel`
Specified by:
  `getCloseSetter` in interface `org.xnio.channels.SuspendableReadChannel`

#### 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`
Throws:
  `IOException`

#### getOption

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

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

#### read

    public int read(ByteBuffer dst)
             throws IOException

Specified by:
  `read` in interface `ReadableByteChannel`
Throws:
  `IOException`

#### getIoThread

    public org.xnio.XnioIoThread getIoThread()

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