| Modifier and Type | Field and Description |
|---|---|
| private final StreamSourceChannel | |
| private final ChannelFunction[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void | awaitReadable()
Implements org. Block until this channel becomes readable again. |
| public void | awaitReadable(long
the time to wait time, 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(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. |
| public boolean | |
| public boolean | isReadResumed()
Implements org. Determine whether reads are resumed. |
| public long | read(ByteBuffer[]
The buffers into which bytes are to be transferred dsts, 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, 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(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 int | read(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(Option<T>
the option to set option, 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(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(long
the position within the file from which the transfer is to begin position, long the number of bytes to be transferred count, FileChannel the file to write to target)Implements org. Transfers bytes into the given file from this channel. |
| public long | transferTo(long
the number of bytes to be transferred count, ByteBuffer the buffer to copy through. throughBuffer, StreamSinkChannel the destination to write to target)Implements org. Transfers bytes into the given channel target. |
| public void | wakeupReads()
Implements org.
|
| channel | back to summary |
|---|---|
| private final StreamSourceChannel channel | |
| functions | back to summary |
|---|---|
| private final ChannelFunction[] functions | |
| ChannelFunctionStreamSourceChannel | back to summary |
|---|---|
| public ChannelFunctionStreamSourceChannel(StreamSourceChannel channel, ChannelFunction... functions) | |
| afterReading | back to summary |
|---|---|
| private void afterReading(ByteBuffer buffer, int position, int length) throws IOException | |
| 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(long time, 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(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.
| |
| 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(ByteBuffer[] dsts, int offset, 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(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 int read(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(Option<T> option, T value) throws 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(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(long position, long count, 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(long count, ByteBuffer throughBuffer, 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.
| |