| Modifier and Type | Field and Description |
|---|---|
| private ChannelListener | |
| private final StreamSinkChannel | |
| private static final int | |
| private static final int | |
| private static final int | |
| private volatile int | |
| private static final AtomicIntegerFieldUpdater | |
| private ChannelListener |
| Access | Constructor and Description |
|---|---|
| public | SplitStreamSinkChannel(final StreamSinkChannel
the delegate channel delegate, boolean true to delegate configuration, false otherwiseConstruct a new instance. |
| public | SplitStreamSinkChannel(final StreamSinkChannel
the delegate channel delegate)Construct a new instance which does not delegate configuration. |
| Modifier and Type | Method and Description |
|---|---|
| public void | awaitWritable()
Implements org. Block until this channel becomes writable again. |
| public void | awaitWritable(final long
the time to wait time, final TimeUnit the time unit timeUnit)Implements org. Block until this channel becomes writable again, or until the timeout expires. |
| public void | close()
Implements java. Close this channel. |
| public boolean | flush()
Implements org. Flush any waiting partial send or write. |
| public ChannelListener | getCloseListener()
Implements org. Get the close listener. |
| public ChannelListener. | getCloseSetter()
Implements org. Get the setter which can be used to change the close listener for this channel. |
| public XnioIoThread | getIoThread()
Implements org. Get the I/O thread associated with this channel. |
| public <T> T | getOption(final Option<T>
the option to get option)Implements org. Get the value of a channel option. |
| public XnioWorker | getWorker()
Implements org. Get the worker for this channel. |
| public ChannelListener | getWriteListener()
Implements org. Get the write listener. |
| public ChannelListener. | getWriteSetter()
Implements org. Get the setter which can be used to change the write listener for this channel. |
| public XnioExecutor | getWriteThread()
Implements org.
Deprecated
Get the write thread for this channel. |
| public boolean | isOpen()
Implements java. Determine whether this channel is open. |
| public boolean | isWriteResumed()
Implements org. Determine whether writes are resumed. |
| public void | resumeWrites()
Implements org. Resume writes on this channel. |
| public void | setCloseListener(final ChannelListener<? super SplitStreamSinkChannel>
the close listener closeListener)Implements org. Set the close listener. |
| public <T> T | setOption(final Option<T>
the option to set option, final T the value of the option to set value)Implements org. Set an option for this channel. |
| public void | setWriteListener(final ChannelListener<? super SplitStreamSinkChannel>
the write listener writeListener)Implements org. Set the write listener. |
| public void | shutdownWrites()
Implements org. Indicate that writing is complete for this channel. |
| public boolean | supportsOption(final Option<?>
the option option)Implements org. Determine whether an option is supported on this channel. |
| public void | suspendWrites()
Implements org. Suspend further write notifications on this channel. |
| public long | transferFrom(final FileChannel
the file to read from src, final long the position within the file from which the transfer is to begin position, final long the number of bytes to be transferred count)Implements org. Transfer bytes into this channel from the given file. |
| public long | transferFrom(final StreamSourceChannel
the source to read from source, final long the number of bytes to be transferred count, final ByteBuffer the buffer to copy through. throughBuffer)Implements org. Transfers bytes from the given channel source. |
| public void | wakeupWrites()
Implements org.
|
| public int | write(final ByteBuffer
The buffer from which bytes are to be retrieved src)Implements java. Writes a sequence of bytes to this channel from the given buffer. |
| public long | write(final ByteBuffer[]
The buffers from which bytes are to be retrieved srcs, final int The offset within the buffer array of the first buffer from
which bytes are to be retrieved; must be non-negative and no
larger than offset, final int srcs.lengthThe maximum number of buffers to be accessed; must be
non-negative and no larger than
length)srcs.length - offsetImplements java. Writes a sequence of bytes to this channel from a subsequence of the given buffers. |
| public long | write(final ByteBuffer[]
The buffers from which bytes are to be retrieved srcs)Implements java. Writes a sequence of bytes to this channel from the given buffers. |
| public int | writeFinal(ByteBuffer
The data to write src)Implements org. Writes some data to the channel, with the same semantics as
|
| public long | writeFinal(ByteBuffer[]
The buffers from which bytes are to be retrieved srcs, int The offset within the buffer array of the first buffer from
which bytes are to be retrieved; must be non-negative and no
larger than srcs.length offset, int The maximum number of buffers to be accessed; must be
non-negative and no larger than
srcs.length - offset length)Implements org. Writes some data to the channel, with the same semantics as
|
| public long | writeFinal(ByteBuffer[]
The buffers from which bytes are to be retrieved srcs)Implements org. Writes some data to the channel, with the same semantics as
|
| closeListener | back to summary |
|---|---|
| private ChannelListener<? super SplitStreamSinkChannel> closeListener | |
| delegate | back to summary |
|---|---|
| private final StreamSinkChannel delegate | |
| FLAG_CLOSE_COMP | back to summary |
|---|---|
| private static final int FLAG_CLOSE_COMP | |
| FLAG_CLOSE_REQ | back to summary |
|---|---|
| private static final int FLAG_CLOSE_REQ | |
| FLAG_DELEGATE_CONFIG | back to summary |
|---|---|
| private static final int FLAG_DELEGATE_CONFIG | |
| state | back to summary |
|---|---|
| private volatile int state | |
| stateUpdater | back to summary |
|---|---|
| private static final AtomicIntegerFieldUpdater<SplitStreamSinkChannel> stateUpdater | |
| writeListener | back to summary |
|---|---|
| private ChannelListener<? super SplitStreamSinkChannel> writeListener | |
| SplitStreamSinkChannel | back to summary |
|---|---|
| public SplitStreamSinkChannel(final StreamSinkChannel delegate, boolean delegateConfig) Construct a new instance.
| |
| SplitStreamSinkChannel | back to summary |
|---|---|
| public SplitStreamSinkChannel(final StreamSinkChannel delegate) Construct a new instance which does not delegate configuration.
| |
| awaitWritable | back to summary |
|---|---|
| public void awaitWritable() throws IOException Implements org. Doc from org. Block until this channel becomes writable again. This method may return spuriously before the channel becomes writable.
| |
| awaitWritable | back to summary |
|---|---|
| public void awaitWritable(final long time, final TimeUnit timeUnit) throws IOException Implements org. Doc from org. Block until this channel becomes writable again, or until the timeout expires. This method may return spuriously before the channel becomes writable or the timeout expires.
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements java. Doc from org. Close this channel. If data has been written but not flushed, that data may be discarded, depending on the channel implementation. When a channel is closed, its close listener is invoked. Invoking this method more than once has no additional effect.
| |
| flush | back to summary |
|---|---|
| public boolean flush() throws IOException Implements org. Doc from org. Flush any waiting partial send or write. If there is no data to flush, or if the flush completed successfully,
this method will return
| |
| getCloseListener | back to summary |
|---|---|
| public ChannelListener Implements org. Doc from org. Get the close listener.
| |
| getCloseSetter | back to summary |
|---|---|
| public ChannelListener. Implements org. Doc from org. Get the setter which can be used to change the close listener for this channel. If the channel is already closed, then the listener will not be called.
| |
| getIoThread | back to summary |
|---|---|
| public XnioIoThread getIoThread() Implements org. Doc from org. Get the I/O thread associated with this channel.
| |
| getOption | back to summary |
|---|---|
| public <T> T getOption(final Option<T> option) throws IOException Implements org. Doc from org. Get the value of a channel option.
| |
| getWorker | back to summary |
|---|---|
| public XnioWorker getWorker() Implements org. Doc from org. Get the worker for this channel.
| |
| getWriteListener | back to summary |
|---|---|
| public ChannelListener Implements org. Doc from org. Get the write listener.
| |
| getWriteSetter | back to summary |
|---|---|
| public ChannelListener. Implements org. Doc from org. Get the setter which can be used to change the write listener for this channel.
| |
| getWriteThread | back to summary |
|---|---|
| public XnioExecutor getWriteThread() Implements org. Doc from org. Deprecated
Get the write thread for this channel.
| |
| isOpen | back to summary |
|---|---|
| public boolean isOpen() Implements java. Doc from org. Determine whether this channel is open. This method will return
| |
| isWriteResumed | back to summary |
|---|---|
| public boolean isWriteResumed() Implements org. Doc from org. Determine whether writes are resumed.
| |
| resumeWrites | back to summary |
|---|---|
| public void resumeWrites() Implements org. Doc from org. Resume writes on this channel. The write listener will be called as soon as the channel becomes writable. | |
| setCloseListener | back to summary |
|---|---|
| public void setCloseListener(final ChannelListener<? super SplitStreamSinkChannel> closeListener) Implements org. Doc from org. Set the close listener.
| |
| setOption | back to summary |
|---|---|
| public <T> T setOption(final Option<T> option, final T value) throws IllegalArgumentException, IOException Implements org. Doc from org. Set an option for this channel. Unsupported options are ignored.
| |
| setWriteListener | back to summary |
|---|---|
| public void setWriteListener(final ChannelListener<? super SplitStreamSinkChannel> writeListener) Implements org. Doc from org. Set the write listener.
| |
| shutdownWrites | back to summary |
|---|---|
| public void shutdownWrites() throws IOException Implements org. Doc from org. Indicate that writing is complete for this channel. Further attempts to write data to this channel
after this method is invoked will result in an exception. If this method was already called, calling this method
again will have no additional effect. After this method is called, any remaining data still must be flushed out
via the
| |
| supportsOption | back to summary |
|---|---|
| public boolean supportsOption(final Option<?> option) Implements org. Doc from org. Determine whether an option is supported on this channel.
| |
| suspendWrites | back to summary |
|---|---|
| public void suspendWrites() Implements org. Doc from org. Suspend further write notifications on this channel. | |
| transferFrom | back to summary |
|---|---|
| public long transferFrom(final FileChannel src, final long position, final long count) throws IOException Implements org. Doc from org. Transfer bytes into this channel from the given file. Using this method in preference to
If the current thread is interrupted when this method is called, it may throw a
| |
| transferFrom | back to summary |
|---|---|
| public long transferFrom(final StreamSourceChannel source, final long count, final ByteBuffer throughBuffer) throws IOException Implements org. Doc from org. Transfers bytes from the given channel source. On some platforms, this may avoid copying bytes between user
and kernel space. On other platforms, bytes are passed through the
If the current thread is interrupted when this method is called, it may throw a
| |
| wakeupWrites | back to summary |
|---|---|
| public void wakeupWrites() Implements org. Doc from org.
| |
| write | back to summary |
|---|---|
| public int write(final ByteBuffer src) throws IOException Implements java. Doc from java. Writes a sequence of bytes to this channel from the given buffer. An attempt is made to write up to r bytes to the channel,
where r is the number of bytes remaining in the buffer, that is,
Suppose that a byte sequence of length n is written, where
Unless otherwise specified, a write operation will return only after writing all of the r requested bytes. Some types of channels, depending upon their state, may write only some of the bytes or possibly none at all. A socket channel in non-blocking mode, for example, cannot write any more bytes than are free in the socket's output buffer. This method may be invoked at any time. If another thread has already initiated a write operation upon this channel, however, then an invocation of this method will block until the first operation is complete.
| |
| write | back to summary |
|---|---|
| public long write(final ByteBuffer[] srcs, final int offset, final int length) throws IOException Implements java. Doc from java. Writes a sequence of bytes to this channel from a subsequence of the given buffers. An attempt is made to write up to r bytes to this channel, where r is the total number of bytes remaining in the specified subsequence of the given buffer array, that is, srcs[offset].remaining() + srcs[offset+1].remaining() + ... + srcs[offset+length-1].remaining() Suppose that a byte sequence of length n is written, where
Unless otherwise specified, a write operation will return only after writing all of the r requested bytes. Some types of channels, depending upon their state, may write only some of the bytes or possibly none at all. A socket channel in non-blocking mode, for example, cannot write any more bytes than are free in the socket's output buffer. This method may be invoked at any time. If another thread has already initiated a write operation upon this channel, however, then an invocation of this method will block until the first operation is complete.
| |
| write | back to summary |
|---|---|
| public long write(final ByteBuffer[] srcs) throws IOException Implements java. Doc from java. Writes a sequence of bytes to this channel from the given buffers. An invocation of this method of the form c.write(srcs, 0, srcs.length);
| |
| writeFinal | back to summary |
|---|---|
| public int writeFinal(ByteBuffer src) throws IOException Implements org. Doc from org. Writes some data to the channel, with the same semantics as
| |
| writeFinal | back to summary |
|---|---|
| public long writeFinal(ByteBuffer[] srcs, int offset, int length) throws IOException Implements org. Doc from org. Writes some data to the channel, with the same semantics as
| |
| writeFinal | back to summary |
|---|---|
| public long writeFinal(ByteBuffer[] srcs) throws IOException Implements org. Doc from org. Writes some data to the channel, with the same semantics as
| |