| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| protected ChannelListener. | |
| protected final StreamSourceChannel | |
| protected ChannelListener. |
| Access | Constructor and Description |
|---|---|
| public |
| 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 | close()
Implements java. Closes this channel. |
| 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. Get the read thread for this channel. |
| public XnioWorker | getWorker()
Implements org. Get the worker for this channel. |
| protected abstract boolean | |
| public boolean | |
| public boolean | isReadResumed()
Implements org. Determine whether reads are resumed. |
| 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 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 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 void | resumeReads()
Implements org. Resume reads 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 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 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.
|
| closeSetter | back to summary |
|---|---|
| protected ChannelListener. | |
| delegate | back to summary |
|---|---|
| protected final StreamSourceChannel delegate | |
| readSetter | back to summary |
|---|---|
| protected ChannelListener. | |
| DetachableStreamSourceChannel | back to summary |
|---|---|
| public DetachableStreamSourceChannel(final StreamSourceChannel delegate) | |
| 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.
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements java. Doc from java. Closes this channel. After a channel is closed, any further attempt to invoke I/O
operations upon it will cause a If this channel is already closed then invoking this method has no effect. This method may be invoked at any time. If some other thread has already invoked it, however, then another invocation will block until the first invocation is complete, after which it will return without effect.
| |
| 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. 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.
| |
| isFinished | back to summary |
|---|---|
| protected abstract boolean isFinished() | |
| isOpen | back to summary |
|---|---|
| public boolean isOpen() Implements java. Doc from java. Tells whether or not this channel is open.
| |
| isReadResumed | back to summary |
|---|---|
| public boolean isReadResumed() Implements org. Doc from org. Determine whether reads are resumed.
| |
| 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);
| |
| 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 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.
| |
| 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.
| |
| 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
| |
| 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. | |
| 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.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final StreamSourceChannel | |
| private final ChannelListener. |
| Access | Constructor and Description |
|---|---|
| pack-priv | SetterDelegatingListener(final ChannelListener.
|
| Modifier and Type | Method and Description |
|---|---|
| public void | handleEvent(final StreamSourceChannel
the channel event channel)Implements org. Handle the event on this channel. |
| public String |
| channel | back to summary |
|---|---|
| private final StreamSourceChannel channel | |
| setter | back to summary |
|---|---|
| private final ChannelListener. | |
| SetterDelegatingListener | back to summary |
|---|---|
| pack-priv SetterDelegatingListener(final ChannelListener. | |
| handleEvent | back to summary |
|---|---|
| public void handleEvent(final StreamSourceChannel channel) Implements org. Doc from org. Handle the event on this channel.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |