| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private ChannelListener | |
| private final ChannelListener. | |
| private int | |
| private long | |
| private volatile PooledByteBuffer | data
The backing data for the current frame. |
| private long | frameDataRemaining
The amount of data left in the frame. |
| private final C | |
| private final Object | |
| private long | |
| private final Deque | |
| private int | |
| private final ChannelListener. | |
| private int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private int | |
| private volatile boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | awaitReadable()
Implements org. Block until this channel becomes readable again. |
| public void | awaitReadable(long
the time to wait l, TimeUnit the time unit timeUnit)Implements org. Block until this channel becomes readable again, or until the timeout expires. |
| private void | |
| protected void | |
| public void | close()
Implements java. Closes this channel. |
| protected void | |
| protected void | dataReady(FrameHeaderData
The frame header data. This may be null if the data is part of a an existing frame headerData, PooledByteBuffer The frame data frameData)Called when data has been read from the underlying channel. |
| private void | |
| private void | |
| public ChannelListener. | getCloseSetter()
Implements org. Get the setter which can be used to change the close listener for this channel. |
| protected C | |
| public XnioIoThread | getIoThread()
Implements org. Get the I/O thread associated with this channel. |
| public long | |
| public <T> T | getOption(Option<T>
the option to get tOption)Implements org. Get the value of a channel option. |
| protected int | |
| private ChannelListener | |
| 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 void | |
| private void | |
| protected boolean | |
| protected boolean | |
| public boolean | |
| public boolean | isReadResumed()
Implements org. Determine whether reads are resumed. |
| protected void | |
| protected void | |
| protected PooledByteBuffer | |
| 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. |
| pack-priv void | resumeReadsInternal(boolean wakeup)
For this class there is no difference between a resume and a wakeup |
| public void | |
| public <T> T | setOption(Option<T>
the option to set tOption, T the value of the option to set t)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 streamSinkChannel)Implements org. Transfers bytes into the given channel target. |
| protected long | |
| public void | wakeupReads()
Implements org.
|
| closeListeners | back to summary |
|---|---|
| private ChannelListener<T extends Channel>[] closeListeners | |
| closeSetter | back to summary |
|---|---|
| private final ChannelListener. | |
| currentDataOriginalSize | back to summary |
|---|---|
| private int currentDataOriginalSize | |
| currentStreamSize | back to summary |
|---|---|
| private long currentStreamSize | |
| data | back to summary |
|---|---|
| private volatile PooledByteBuffer data The backing data for the current frame. | |
| frameDataRemaining | back to summary |
|---|---|
| private long frameDataRemaining The amount of data left in the frame. If this is larger than the data in the backing buffer then | |
| framedChannel | back to summary |
|---|---|
| private final C framedChannel | |
| lock | back to summary |
|---|---|
| private final Object lock | |
| maxStreamSize | back to summary |
|---|---|
| private long maxStreamSize | |
| pendingFrameData | back to summary |
|---|---|
| private final Deque<AbstractFramedStreamSourceChannel<C, R, S>. | |
| readFrameCount | back to summary |
|---|---|
| private int readFrameCount | |
| readSetter | back to summary |
|---|---|
| private final ChannelListener. | |
| state | back to summary |
|---|---|
| private int state | |
| STATE_CLOSED | back to summary |
|---|---|
| private static final int STATE_CLOSED | |
| STATE_DONE | back to summary |
|---|---|
| private static final int STATE_DONE | |
| STATE_IN_LISTENER_LOOP | back to summary |
|---|---|
| private static final int STATE_IN_LISTENER_LOOP | |
| STATE_LAST_FRAME | back to summary |
|---|---|
| private static final int STATE_LAST_FRAME | |
| STATE_READS_AWAKEN | back to summary |
|---|---|
| private static final int STATE_READS_AWAKEN | |
| STATE_READS_RESUMED | back to summary |
|---|---|
| private static final int STATE_READS_RESUMED | |
| STATE_RETURNED_MINUS_ONE | back to summary |
|---|---|
| private static final int STATE_RETURNED_MINUS_ONE | |
| STATE_STREAM_BROKEN | back to summary |
|---|---|
| private static final int STATE_STREAM_BROKEN | |
| STATE_WAITNG_MINUS_ONE | back to summary |
|---|---|
| private static final int STATE_WAITNG_MINUS_ONE | |
| waiters | back to summary |
|---|---|
| private int waiters | |
| waitingForFrame | back to summary |
|---|---|
| private volatile boolean waitingForFrame | |
| AbstractFramedStreamSourceChannel | back to summary |
|---|---|
| public AbstractFramedStreamSourceChannel(C framedChannel) | |
| AbstractFramedStreamSourceChannel | back to summary |
|---|---|
| public AbstractFramedStreamSourceChannel(C framedChannel, PooledByteBuffer data, long frameDataRemaining) | |
| addCloseTask | back to summary |
|---|---|
| public void addCloseTask(ChannelListener<R> channelListener) | |
| 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 l, 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.
| |
| beforeRead | back to summary |
|---|---|
| private void beforeRead() throws IOException | |
| channelForciblyClosed | back to summary |
|---|---|
| protected void channelForciblyClosed() | |
| close | back to summary |
|---|---|
| public void close() 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.
| |
| complete | back to summary |
|---|---|
| protected void complete() throws IOException Method that is invoked when all data has been read. | |
| dataReady | back to summary |
|---|---|
| protected void dataReady(FrameHeaderData headerData, PooledByteBuffer frameData) Called when data has been read from the underlying channel.
| |
| decrementFrameDataRemaining | back to summary |
|---|---|
| private void decrementFrameDataRemaining() | |
| exitRead | back to summary |
|---|---|
| private void exitRead() throws IOException | |
| 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.
| |
| getFramedChannel | back to summary |
|---|---|
| protected C getFramedChannel() | |
| getIoThread | back to summary |
|---|---|
| public XnioIoThread getIoThread() Implements org. Doc from org. Get the I/O thread associated with this channel.
| |
| getMaxStreamSize | back to summary |
|---|---|
| public long getMaxStreamSize() | |
| getOption | back to summary |
|---|---|
| public <T> T getOption(Option<T> tOption) throws IOException Implements org. Doc from org. Get the value of a channel option.
| |
| getReadFrameCount | back to summary |
|---|---|
| protected int getReadFrameCount() | |
| getReadListener | back to summary |
|---|---|
| private ChannelListener | |
| 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.
| |
| handleHeaderData | back to summary |
|---|---|
| protected void handleHeaderData(FrameHeaderData headerData) | |
| handleStreamTooLarge | back to summary |
|---|---|
| private void handleStreamTooLarge() | |
| isComplete | back to summary |
|---|---|
| protected boolean isComplete() | |
| isLastFrame | back to summary |
|---|---|
| protected boolean isLastFrame() | |
| 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.
| |
| lastFrame | back to summary |
|---|---|
| protected void lastFrame() | |
| markStreamBroken | back to summary |
|---|---|
| protected void markStreamBroken() Called when this stream is no longer valid. Reads from the stream will result in an exception. | |
| processFrameData | back to summary |
|---|---|
| protected PooledByteBuffer processFrameData(PooledByteBuffer data, boolean lastFragmentOfFrame) throws IOException | |
| 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.
| |
| resumeReadsInternal | back to summary |
|---|---|
| pack-priv void resumeReadsInternal(boolean wakeup) For this class there is no difference between a resume and a wakeup | |
| setMaxStreamSize | back to summary |
|---|---|
| public void setMaxStreamSize(long maxStreamSize) | |
| setOption | back to summary |
|---|---|
| public <T> T setOption(Option<T> tOption, T t) 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(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 streamSinkChannel) 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
| |
| updateFrameDataRemaining | back to summary |
|---|---|
| protected long updateFrameDataRemaining(PooledByteBuffer frameData, long frameDataRemaining) | |
| wakeupReads | back to summary |
|---|---|
| public void wakeupReads() Implements org. Doc from org.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final PooledByteBuffer | |
| private final FrameHeaderData |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv PooledByteBuffer | |
| pack-priv FrameHeaderData |
| frameData | back to summary |
|---|---|
| private final PooledByteBuffer frameData | |
| frameHeaderData | back to summary |
|---|---|
| private final FrameHeaderData frameHeaderData | |
| FrameData | back to summary |
|---|---|
| pack-priv FrameData(FrameHeaderData frameHeaderData, PooledByteBuffer frameData) | |
| getFrameData | back to summary |
|---|---|
| pack-priv PooledByteBuffer getFrameData() | |
| getFrameHeaderData | back to summary |
|---|---|
| pack-priv FrameHeaderData getFrameHeaderData() | |