public abstract class AbstractFramedStreamSourceChannel<C extends AbstractFramedChannel<C,R,S>,R extends AbstractFramedStreamSourceChannel<C,R,S>,S extends AbstractFramedStreamSinkChannel<C,R,S>> extends Object implements org.xnio.channels.StreamSourceChannel
| Constructor and Description |
|---|
AbstractFramedStreamSourceChannel(C framedChannel) |
AbstractFramedStreamSourceChannel(C framedChannel, PooledByteBuffer data, long frameDataRemaining) |
| Modifier and Type | Method and Description |
|---|---|
void | addCloseTask(org.xnio.ChannelListener<R> channelListener) |
void | awaitReadable() |
void | awaitReadable(long l, TimeUnit timeUnit) |
protected void | channelForciblyClosed() |
void | close() |
protected void | complete() Method that is invoked when all data has been read. |
protected void | dataReady(FrameHeaderData headerData, PooledByteBuffer frameData) Called when data has been read from the underlying channel. |
org.xnio.ChannelListener.Setter<? extends R> | getCloseSetter() |
protected C | getFramedChannel() |
org.xnio.XnioIoThread | getIoThread() |
long | getMaxStreamSize() |
<T> T | getOption(org.xnio.Option<T> tOption) |
protected int | getReadFrameCount() |
org.xnio.ChannelListener.Setter<? extends R> | getReadSetter() |
org.xnio.XnioExecutor | getReadThread() |
org.xnio.XnioWorker | getWorker() |
protected void | handleHeaderData(FrameHeaderData headerData) |
protected boolean | isComplete() |
protected boolean | isLastFrame() |
boolean | isOpen() |
boolean | isReadResumed() |
protected void | lastFrame() |
protected void | markStreamBroken() Called when this stream is no longer valid. |
protected PooledByteBuffer | processFrameData(PooledByteBuffer data, boolean lastFragmentOfFrame) |
int | read(ByteBuffer dst) |
long | read(ByteBuffer[] dsts) |
long | read(ByteBuffer[] dsts, int offset, int length) |
void | resumeReads() |
void | setMaxStreamSize(long maxStreamSize) |
<T> T | setOption(org.xnio.Option<T> tOption, T t) |
void | shutdownReads() |
boolean | supportsOption(org.xnio.Option<?> option) |
void | suspendReads() |
long | transferTo(long count, ByteBuffer throughBuffer, org.xnio.channels.StreamSinkChannel streamSinkChannel) |
long | transferTo(long position, long count, FileChannel target) |
protected long | updateFrameDataRemaining(PooledByteBuffer frameData, long frameDataRemaining) |
void | wakeupReads() |
public AbstractFramedStreamSourceChannel(C framedChannel)
public AbstractFramedStreamSourceChannel(C framedChannel, PooledByteBuffer data, long frameDataRemaining)
public long transferTo(long position,
long count,
FileChannel target)
throws IOException transferTo in interface org.xnio.channels.StreamSourceChannelIOExceptionpublic long transferTo(long count,
ByteBuffer throughBuffer,
org.xnio.channels.StreamSinkChannel streamSinkChannel)
throws IOException transferTo in interface org.xnio.channels.StreamSourceChannelIOExceptionpublic long getMaxStreamSize()
public void setMaxStreamSize(long maxStreamSize)
public void suspendReads()
suspendReads in interface org.xnio.channels.SuspendableReadChannelprotected void complete()
throws IOException IOExceptionprotected boolean isComplete()
public void resumeReads()
resumeReads in interface org.xnio.channels.SuspendableReadChannelpublic boolean isReadResumed()
isReadResumed in interface org.xnio.channels.SuspendableReadChannelpublic void wakeupReads()
wakeupReads in interface org.xnio.channels.SuspendableReadChannelpublic void addCloseTask(org.xnio.ChannelListener<R> channelListener)
public void shutdownReads()
throws IOException shutdownReads in interface org.xnio.channels.SuspendableReadChannelIOExceptionprotected void lastFrame()
protected boolean isLastFrame()
public void awaitReadable()
throws IOException awaitReadable in interface org.xnio.channels.SuspendableReadChannelIOExceptionpublic void awaitReadable(long l,
TimeUnit timeUnit)
throws IOException awaitReadable in interface org.xnio.channels.SuspendableReadChannelIOExceptionprotected void dataReady(FrameHeaderData headerData, PooledByteBuffer frameData)
headerData - The frame header data. This may be null if the data is part of a an existing frameframeData - The frame dataprotected long updateFrameDataRemaining(PooledByteBuffer frameData, long frameDataRemaining)
protected PooledByteBuffer processFrameData(PooledByteBuffer data, boolean lastFragmentOfFrame) throws IOException
IOExceptionprotected void handleHeaderData(FrameHeaderData headerData)
public org.xnio.XnioExecutor getReadThread()
getReadThread in interface org.xnio.channels.SuspendableReadChannelpublic org.xnio.ChannelListener.Setter<? extends R> getReadSetter()
getReadSetter in interface org.xnio.channels.StreamSourceChannelgetReadSetter in interface org.xnio.channels.SuspendableReadChannelpublic org.xnio.ChannelListener.Setter<? extends R> getCloseSetter()
getCloseSetter in interface org.xnio.channels.CloseableChannelgetCloseSetter in interface org.xnio.channels.StreamSourceChannelgetCloseSetter in interface org.xnio.channels.SuspendableReadChannelpublic org.xnio.XnioWorker getWorker()
getWorker in interface org.xnio.channels.CloseableChannelpublic org.xnio.XnioIoThread getIoThread()
getIoThread in interface org.xnio.channels.CloseableChannelpublic boolean supportsOption(org.xnio.Option<?> option)
supportsOption in interface org.xnio.channels.Configurablepublic <T> T getOption(org.xnio.Option<T> tOption)
throws IOException getOption in interface org.xnio.channels.ConfigurableIOExceptionpublic <T> T setOption(org.xnio.Option<T> tOption,
T t)
throws IllegalArgumentException,
IOException setOption in interface org.xnio.channels.ConfigurableIllegalArgumentExceptionIOExceptionpublic long read(ByteBuffer[] dsts, int offset, int length) throws IOException
read in interface ScatteringByteChannelIOExceptionpublic long read(ByteBuffer[] dsts) throws IOException
read in interface ScatteringByteChannelIOExceptionpublic int read(ByteBuffer dst) throws IOException
read in interface ReadableByteChannelIOExceptionpublic void close()
close in interface Closeableclose in interface AutoCloseableclose in interface Channelclose in interface InterruptibleChannelclose in interface org.xnio.channels.CloseableChannelprotected void channelForciblyClosed()
protected C getFramedChannel()
protected int getReadFrameCount()
protected void markStreamBroken()
Copyright © 2020 JBoss by Red Hat. All rights reserved.