public class Http2StreamSourceChannel extends AbstractHttp2StreamSourceChannel implements Http2Stream
Modifier and Type | Class and Description |
---|---|
static interface |
Http2StreamSourceChannel.TrailersHandler |
EMPTY
Modifier and Type | Method and Description |
---|---|
protected void |
channelForciblyClosed() |
protected void |
complete()
Method that is invoked when all data has been read.
|
ChannelListener<Http2StreamSourceChannel> |
getCompletionListener() |
HeaderMap |
getHeaders() |
Http2HeadersStreamSinkChannel |
getResponseChannel() |
int |
getStreamId() |
Http2StreamSourceChannel.TrailersHandler |
getTrailersHandler() |
protected void |
handleHeaderData(FrameHeaderData headerData) |
boolean |
isIgnoreForceClose() |
int |
read(ByteBuffer dst) |
long |
read(ByteBuffer[] dsts) |
long |
read(ByteBuffer[] dsts,
int offset,
int length) |
void |
setCompletionListener(ChannelListener<Http2StreamSourceChannel> completionListener) |
void |
setIgnoreForceClose(boolean ignoreForceClose) |
void |
setTrailersHandler(Http2StreamSourceChannel.TrailersHandler trailersHandler) |
String |
toString() |
long |
transferTo(long count,
ByteBuffer throughBuffer,
StreamSinkChannel streamSinkChannel)
Transfers bytes into the given channel target.
|
long |
transferTo(long position,
long count,
FileChannel target)
Transfers bytes into the given file from this channel.
|
protected long |
updateFrameDataRemaining(PooledByteBuffer data,
long frameDataRemaining) |
getFramedChannel, getHttp2Channel, lastFrame, markStreamBroken
addCloseTask, awaitReadable, awaitReadable, close, dataReady, getCloseSetter, getIoThread, getMaxStreamSize, getOption, getReadFrameCount, getReadSetter, getReadThread, getWorker, isComplete, isLastFrame, isOpen, isReadResumed, processFrameData, resumeReads, setMaxStreamSize, setOption, shutdownReads, supportsOption, suspendReads, wakeupReads
protected void handleHeaderData(FrameHeaderData headerData)
handleHeaderData
in class AbstractHttp2StreamSourceChannel
protected long updateFrameDataRemaining(PooledByteBuffer data, long frameDataRemaining)
public Http2HeadersStreamSinkChannel getResponseChannel()
public int read(ByteBuffer dst) throws IOException
read
in interface ReadableByteChannel
read
in class AbstractFramedStreamSourceChannel<Http2Channel,AbstractHttp2StreamSourceChannel,AbstractHttp2StreamSinkChannel>
IOException
public long read(ByteBuffer[] dsts, int offset, int length) throws IOException
read
in interface ScatteringByteChannel
read
in class AbstractFramedStreamSourceChannel<Http2Channel,AbstractHttp2StreamSourceChannel,AbstractHttp2StreamSinkChannel>
IOException
public long read(ByteBuffer[] dsts) throws IOException
read
in interface ScatteringByteChannel
read
in class AbstractFramedStreamSourceChannel<Http2Channel,AbstractHttp2StreamSourceChannel,AbstractHttp2StreamSinkChannel>
IOException
public long transferTo(long count, ByteBuffer throughBuffer, StreamSinkChannel streamSinkChannel) throws IOException
StreamSourceChannel
throughBuffer
parameter's buffer
space. On entry, throughBuffer
will be cleared. On exit, the buffer will be
flipped for emptying, and may possibly be empty or may contain data. If this method returns a value less than
count
, then the remaining data in throughBuffer
may contain data read from this channel which must
be written to target
to complete the operation. Note that using a direct buffer may provide an
intermediate performance gain on platforms without zero-copy facilities.
If the current thread is interrupted when this method is called, it may throw a InterruptedIOException
;
however, if this exception is thrown, the InterruptedIOException.bytesTransferred
field is
guaranteed to be 0.
Note that the return value is the amount of data that was actually transferred to the StreamSinkChannel
.
The actual amount of data read could be larger than this, and can be calculated by adding the return value and
the amount of data left in throughBuffer
.
transferTo
in interface StreamSourceChannel
transferTo
in class AbstractFramedStreamSourceChannel<Http2Channel,AbstractHttp2StreamSourceChannel,AbstractHttp2StreamSinkChannel>
count
- the number of bytes to be transferredthroughBuffer
- the buffer to copy through.streamSinkChannel
- the destination to write toIOException
- if an I/O error occurspublic long transferTo(long position, long count, FileChannel target) throws IOException
StreamSourceChannel
FileChannel.transferFrom(ReadableByteChannel, long, long)
may provide a performance advantage on some platforms.
If the current thread is interrupted when this method is called, it may throw a InterruptedIOException
;
however, if this exception is thrown, the InterruptedIOException.bytesTransferred
field is
guaranteed to be 0.
transferTo
in interface StreamSourceChannel
transferTo
in class AbstractFramedStreamSourceChannel<Http2Channel,AbstractHttp2StreamSourceChannel,AbstractHttp2StreamSinkChannel>
position
- the position within the file from which the transfer is to begincount
- the number of bytes to be transferredtarget
- the file to write toIOException
- if an I/O error occursprotected void complete() throws IOException
AbstractFramedStreamSourceChannel
complete
in class AbstractFramedStreamSourceChannel<Http2Channel,AbstractHttp2StreamSourceChannel,AbstractHttp2StreamSinkChannel>
IOException
public HeaderMap getHeaders()
public ChannelListener<Http2StreamSourceChannel> getCompletionListener()
public void setCompletionListener(ChannelListener<Http2StreamSourceChannel> completionListener)
protected void channelForciblyClosed()
public void setIgnoreForceClose(boolean ignoreForceClose)
public boolean isIgnoreForceClose()
public int getStreamId()
getStreamId
in interface Http2Stream
public Http2StreamSourceChannel.TrailersHandler getTrailersHandler()
public void setTrailersHandler(Http2StreamSourceChannel.TrailersHandler trailersHandler)
Copyright © 2018 JBoss by Red Hat. All rights reserved.