| Modifier and Type | Field and Description |
|---|---|
| private final CloseableChannel | |
| private final ChannelListener. | |
| private final ChannelListener. | |
| private final StreamSinkChannel | |
| private final StreamSourceChannel | |
| private final ChannelListener. |
| Access | Constructor and Description |
|---|---|
| public | AssembledStreamChannel(final CloseableChannel
the single central closeable channel closeable, final StreamSourceChannel the stream source channel source, final StreamSinkChannel the stream sink channel sink)Construct a new instance. |
| public | AssembledStreamChannel(final StreamSourceChannel
the stream source channel source, final StreamSinkChannel the stream sink channel sink)Construct a new instance. |
| Modifier and Type | Method and Description |
|---|---|
| public void | awaitReadable()
Implements org. Block until this channel becomes readable again. |
| public void | awaitReadable(final long
the time to wait time, final TimeUnit the time unit timeUnit)Implements org. Block until this channel becomes readable again, or until the timeout expires. |
| 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 org. Close this channel. |
| public boolean | flush()
Implements org. Flush any waiting partial send or write. |
| 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 ChannelListener. | getReadSetter()
Implements org. Get the setter which can be used to change the read listener for this channel. |
| public XnioExecutor | getReadThread()
Implements org.
Deprecated
Get the read thread for this channel. |
| public XnioWorker | getWorker()
Implements org. Get the worker for this channel. |
| 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 | isReadResumed()
Implements org. Determine whether reads are resumed. |
| public boolean | isWriteResumed()
Implements org. Determine whether writes are resumed. |
| public int | read(final ByteBuffer
The buffer into which bytes are to be transferred dst)Implements java. Reads a sequence of bytes from this channel into the given buffer. |
| public long | read(final ByteBuffer[]
The buffers into which bytes are to be transferred dsts, final int The offset within the buffer array of the first buffer into
which bytes are to be transferred; must be non-negative and no
larger than offset, final int dsts.lengthThe maximum number of buffers to be accessed; must be
non-negative and no larger than
length)dsts.length - offsetImplements java. Reads a sequence of bytes from this channel into a subsequence of the given buffers. |
| public long | read(final ByteBuffer[]
The buffers into which bytes are to be transferred dsts)Implements java. Reads a sequence of bytes from this channel into the given buffers. |
| public void | resumeReads()
Implements org. Resume reads on this channel. |
| public void | resumeWrites()
Implements org. Resume writes on this channel. |
| 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 | shutdownReads()
Implements org. Places this readable channel at "end of stream". |
| 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 | suspendReads()
Implements org. Suspend further read notifications 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 long | transferTo(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, final FileChannel the file to write to target)Implements org. Transfers bytes into the given file from this channel. |
| public long | transferTo(final long
the number of bytes to be transferred count, final ByteBuffer the buffer to copy through. throughBuffer, final StreamSinkChannel the destination to write to target)Implements org. Transfers bytes into the given channel target. |
| public void | wakeupReads()
Implements org.
|
| 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
|
| closeable | back to summary |
|---|---|
| private final CloseableChannel closeable | |
| closeSetter | back to summary |
|---|---|
| private final ChannelListener. | |
| readSetter | back to summary |
|---|---|
| private final ChannelListener. | |
| sink | back to summary |
|---|---|
| private final StreamSinkChannel sink | |
| source | back to summary |
|---|---|
| private final StreamSourceChannel source | |
| writeSetter | back to summary |
|---|---|
| private final ChannelListener. | |
| AssembledStreamChannel | back to summary |
|---|---|
| public AssembledStreamChannel(final CloseableChannel closeable, final StreamSourceChannel source, final StreamSinkChannel sink) Construct a new instance.
| |
| AssembledStreamChannel | back to summary |
|---|---|
| public AssembledStreamChannel(final StreamSourceChannel source, final StreamSinkChannel sink) Construct a new instance.
| |
| awaitReadable | back to summary |
|---|---|
| public void awaitReadable() throws IOException Implements org. Doc from org. Block until this channel becomes readable again. This method may return spuriously before the channel becomes readable.
| |
| awaitReadable | back to summary |
|---|---|
| public void awaitReadable(final long time, final TimeUnit timeUnit) throws IOException Implements org. Doc from org. Block until this channel becomes readable again, or until the timeout expires. This method may return spuriously before the channel becomes readable or the timeout expires.
| |
| 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 org. Doc from org. Close this channel. 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
| |
| 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.
| |
| getReadSetter | back to summary |
|---|---|
| public ChannelListener. Implements org. Doc from org. Get the setter which can be used to change the read listener for this channel.
| |
| getReadThread | back to summary |
|---|---|
| public XnioExecutor getReadThread() Implements org. Doc from org. Deprecated
Get the read thread for this channel.
| |
| getWorker | back to summary |
|---|---|
| public XnioWorker getWorker() Implements org. Doc from org. Get the worker for this channel.
| |
| 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
| |
| isReadResumed | back to summary |
|---|---|
| public boolean isReadResumed() Implements org. Doc from org. Determine whether reads are resumed.
| |
| isWriteResumed | back to summary |
|---|---|
| public boolean isWriteResumed() Implements org. Doc from org. Determine whether writes are resumed.
| |
| read | back to summary |
|---|---|
| public int read(final ByteBuffer dst) throws IOException Implements java. Doc from java. Reads a sequence of bytes from this channel into the given buffer. An attempt is made to read up to r bytes from the channel,
where r is the number of bytes remaining in the buffer, that is,
Suppose that a byte sequence of length n is read, where
A read operation might not fill the buffer, and in fact it might not read any bytes at all. Whether or not it does so depends upon the nature and state of the channel. A socket channel in non-blocking mode, for example, cannot read any more bytes than are immediately available from the socket's input buffer; similarly, a file channel cannot read any more bytes than remain in the file. It is guaranteed, however, that if a channel is in blocking mode and there is at least one byte remaining in the buffer then this method will block until at least one byte is read. This method may be invoked at any time. If another thread has already initiated a read operation upon this channel, however, then an invocation of this method will block until the first operation is complete.
| |
| read | back to summary |
|---|---|
| public long read(final ByteBuffer[] dsts, final int offset, final int length) throws IOException Implements java. Doc from java. Reads a sequence of bytes from this channel into a subsequence of the given buffers. An invocation of this method attempts to read up to r bytes from this channel, where r is the total number of bytes remaining in the specified subsequence of the given buffer array, that is, dsts[offset].remaining() + dsts[offset+1].remaining() + ... + dsts[offset+length-1].remaining() Suppose that a byte sequence of length n is read, where
This method may be invoked at any time. If another thread has already initiated a read operation upon this channel, however, then an invocation of this method will block until the first operation is complete.
| |
| read | back to summary |
|---|---|
| public long read(final ByteBuffer[] dsts) throws IOException Implements java. Doc from java. Reads a sequence of bytes from this channel into the given buffers. An invocation of this method of the form c.read(dsts, 0, dsts.length);
| |
| resumeReads | back to summary |
|---|---|
| public void resumeReads() Implements org. Doc from org. Resume reads on this channel. The read listener will be called as soon as there is data available to be read. | |
| 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. | |
| 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.
| |
| shutdownReads | back to summary |
|---|---|
| public void shutdownReads() throws IOException Implements org. Doc from org. Places this readable channel at "end of stream". Further reads will result in EOF.
Shutting down all directions of a channel will cause
| |
| 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.
| |
| suspendReads | back to summary |
|---|---|
| public void suspendReads() Implements org. Doc from org. Suspend further read notifications 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
| |
| transferTo | back to summary |
|---|---|
| public long transferTo(final long position, final long count, final FileChannel target) throws IOException Implements org. Doc from org. Transfers bytes into the given file from this channel. Using this method in preference to
If the current thread is interrupted when this method is called, it may throw a
| |
| transferTo | back to summary |
|---|---|
| public long transferTo(final long count, final ByteBuffer throughBuffer, final StreamSinkChannel target) throws IOException Implements org. Doc from org. Transfers bytes into the given channel target. 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
| |
| wakeupReads | back to summary |
|---|---|
| public void wakeupReads() Implements org. Doc from org.
| |
| 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
| |