public abstract class StreamSourceFrameChannel extends AbstractFramedStreamSourceChannel<WebSocketChannel,StreamSourceFrameChannel,StreamSinkFrameChannel>
Modifier and Type | Field and Description |
---|---|
protected WebSocketFrameType | type |
Modifier | Constructor and Description |
---|---|
protected | StreamSourceFrameChannel(WebSocketChannel wsChannel, WebSocketFrameType type, int rsv, boolean finalFragment, PooledByteBuffer pooled, long frameLength, Masker masker, ChannelFunction... functions) |
protected | StreamSourceFrameChannel(WebSocketChannel wsChannel, WebSocketFrameType type, PooledByteBuffer pooled, long frameLength) |
Modifier and Type | Method and Description |
---|---|
protected void | afterRead(ByteBuffer buffer, int position, int length) Called after data was read into the ByteBuffer |
protected void | checker(ByteBuffer buffer, int position, int length, boolean complete) |
void | finalFrame() |
protected WebSocketChannel | getFramedChannel() |
int | getRsv() Return the rsv which is used for extensions. |
WebSocketFrameType | getType() Return the WebSocketFrameType or null if its not known at the calling time. |
WebSocketChannel | getWebSocketChannel() |
protected void | handleHeaderData(FrameHeaderData headerData) |
boolean | isFinalFragment() Flag to indicate if this frame is the final fragment in a message. |
protected PooledByteBuffer | processFrameData(PooledByteBuffer frameData, boolean lastFragmentOfFrame) |
int | read(ByteBuffer dst) |
long | read(ByteBuffer[] dsts) |
long | read(ByteBuffer[] dsts, int offset, int length) |
long | transferTo(long count, ByteBuffer throughBuffer, org.xnio.channels.StreamSinkChannel target) |
long | transferTo(long position, long count, FileChannel target) |
addCloseTask, awaitReadable, awaitReadable, channelForciblyClosed, close, complete, dataReady, getCloseSetter, getIoThread, getMaxStreamSize, getOption, getReadFrameCount, getReadSetter, getReadThread, getWorker, isComplete, isLastFrame, isOpen, isReadResumed, lastFrame, markStreamBroken, resumeReads, setMaxStreamSize, setOption, shutdownReads, supportsOption, suspendReads, updateFrameDataRemaining, wakeupReads
protected final WebSocketFrameType type
protected StreamSourceFrameChannel(WebSocketChannel wsChannel, WebSocketFrameType type, PooledByteBuffer pooled, long frameLength)
protected StreamSourceFrameChannel(WebSocketChannel wsChannel, WebSocketFrameType type, int rsv, boolean finalFragment, PooledByteBuffer pooled, long frameLength, Masker masker, ChannelFunction... functions)
public WebSocketFrameType getType()
WebSocketFrameType
or null
if its not known at the calling time.public boolean isFinalFragment()
public int getRsv()
protected WebSocketChannel getFramedChannel()
public WebSocketChannel getWebSocketChannel()
public void finalFrame()
protected void handleHeaderData(FrameHeaderData headerData)
public final long transferTo(long position, long count, FileChannel target) throws IOException
transferTo
in interface org.xnio.channels.StreamSourceChannel
transferTo
in class AbstractFramedStreamSourceChannel<WebSocketChannel,StreamSourceFrameChannel,StreamSinkFrameChannel>
IOException
public final long transferTo(long count, ByteBuffer throughBuffer, org.xnio.channels.StreamSinkChannel target) throws IOException
transferTo
in interface org.xnio.channels.StreamSourceChannel
transferTo
in class AbstractFramedStreamSourceChannel<WebSocketChannel,StreamSourceFrameChannel,StreamSinkFrameChannel>
IOException
public int read(ByteBuffer dst) throws IOException
read
in interface ReadableByteChannel
read
in class AbstractFramedStreamSourceChannel<WebSocketChannel,StreamSourceFrameChannel,StreamSinkFrameChannel>
IOException
public final long read(ByteBuffer[] dsts) throws IOException
read
in interface ScatteringByteChannel
read
in class AbstractFramedStreamSourceChannel<WebSocketChannel,StreamSourceFrameChannel,StreamSinkFrameChannel>
IOException
public long read(ByteBuffer[] dsts, int offset, int length) throws IOException
read
in interface ScatteringByteChannel
read
in class AbstractFramedStreamSourceChannel<WebSocketChannel,StreamSourceFrameChannel,StreamSinkFrameChannel>
IOException
protected void afterRead(ByteBuffer buffer, int position, int length) throws IOException
ByteBuffer
buffer
- the ByteBuffer
into which the data was readposition
- the position it was written tolength
- the number of bytes there were writtenIOException
- thrown if an error occursprotected void checker(ByteBuffer buffer, int position, int length, boolean complete) throws IOException
IOException
protected PooledByteBuffer processFrameData(PooledByteBuffer frameData, boolean lastFragmentOfFrame) throws IOException
processFrameData
in class AbstractFramedStreamSourceChannel<WebSocketChannel,StreamSourceFrameChannel,StreamSinkFrameChannel>
IOException
Copyright © 2017 JBoss by Red Hat. All rights reserved.