public class Http2DataStreamSinkChannel extends Http2StreamSinkChannel implements Http2Stream
Modifier and Type | Class and Description |
---|---|
static interface |
Http2DataStreamSinkChannel.TrailersProducer |
EMPTY
allocateAll, createFrameHeader, getStreamId, grabFlowControlBytes
isLastFrame
awaitWritable, awaitWritable, close, getBuffer, getChannel, getCloseSetter, getIoThread, getOption, getWorker, getWriteSetter, getWriteThread, isBroken, isBufferFull, isFinalFrameQueued, isFirstDataWritten, isOpen, isReadyForFlush, isWriteResumed, isWritesShutdown, markBroken, preWriteTransform, resumeWrites, resumeWritesInternal, safeToSend, send, sendInternal, setOption, shutdownWrites, supportsOption, suspendWrites, transferFrom, transferFrom, wakeupWrites
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getStreamId
public Http2DataStreamSinkChannel.TrailersProducer getTrailersProducer()
public void setTrailersProducer(Http2DataStreamSinkChannel.TrailersProducer trailersProducer)
protected SendFrameHeader createFrameHeaderImpl()
createFrameHeaderImpl
in class Http2StreamSinkChannel
public long write(ByteBuffer[] srcs, int offset, int length) throws IOException
write
in interface GatheringByteChannel
write
in class AbstractFramedStreamSinkChannel<Http2Channel,AbstractHttp2StreamSourceChannel,AbstractHttp2StreamSinkChannel>
IOException
public long write(ByteBuffer[] srcs) throws IOException
write
in interface GatheringByteChannel
write
in class AbstractFramedStreamSinkChannel<Http2Channel,AbstractHttp2StreamSourceChannel,AbstractHttp2StreamSinkChannel>
IOException
public int write(ByteBuffer src) throws IOException
write
in interface WritableByteChannel
write
in class AbstractFramedStreamSinkChannel<Http2Channel,AbstractHttp2StreamSourceChannel,AbstractHttp2StreamSinkChannel>
IOException
public long writeFinal(ByteBuffer[] srcs, int offset, int length) throws IOException
StreamSinkChannel
GatheringByteChannel.write(java.nio.ByteBuffer[], int, int)
. If all the data is written
out then the channel will have its writes shutdown.
If an exception is thrown the caller is still responsible for closing the channel.writeFinal
in interface StreamSinkChannel
writeFinal
in class AbstractFramedStreamSinkChannel<Http2Channel,AbstractHttp2StreamSourceChannel,AbstractHttp2StreamSinkChannel>
srcs
- The buffers from which bytes are to be retrievedoffset
- The offset within the buffer array of the first buffer from
which bytes are to be retrieved; must be non-negative and no
larger than srcs.lengthlength
- The maximum number of buffers to be accessed; must be
non-negative and no larger than
srcs.length - offsetIOException
GatheringByteChannel.write(java.nio.ByteBuffer[], int, int)
,
SuspendableWriteChannel.shutdownWrites()
public long writeFinal(ByteBuffer[] srcs) throws IOException
StreamSinkChannel
GatheringByteChannel.write(java.nio.ByteBuffer[])
. If all the data is written
out then the channel will have its writes shutdown.
If an exception is thrown the caller is still responsible for closing the channel.writeFinal
in interface StreamSinkChannel
writeFinal
in class AbstractFramedStreamSinkChannel<Http2Channel,AbstractHttp2StreamSourceChannel,AbstractHttp2StreamSinkChannel>
srcs
- The buffers from which bytes are to be retrievedIOException
GatheringByteChannel.write(java.nio.ByteBuffer[])
,
SuspendableWriteChannel.shutdownWrites()
public int writeFinal(ByteBuffer src) throws IOException
StreamSinkChannel
WritableByteChannel.write(java.nio.ByteBuffer)
. If all the data is written
out then the channel will have its writes shutdown. Semantically this
method is equivalent to:
int rem = src.remaining();
int written = channel.write(src);
if(written == rem) {
channel.shutdownWrites()
}
If an exception is thrown the caller is still responsible for closing the channel.writeFinal
in interface StreamSinkChannel
writeFinal
in class AbstractFramedStreamSinkChannel<Http2Channel,AbstractHttp2StreamSourceChannel,AbstractHttp2StreamSinkChannel>
src
- The data to writeIOException
WritableByteChannel.write(java.nio.ByteBuffer)
,
SuspendableWriteChannel.shutdownWrites()
public boolean flush() throws IOException
SuspendableWriteChannel
true
. If there is data to flush which cannot be immediately written, this method
will return false
. If this method returns true
after SuspendableWriteChannel.shutdownWrites()
was called on
this channel, the write listener will no longer be invoked on this channel. If this is case and additionally
this is a write-only channel or the read side was previously shut down, then the channel will
automatically be closed.flush
in interface SuspendableWriteChannel
flush
in class AbstractFramedStreamSinkChannel<Http2Channel,AbstractHttp2StreamSourceChannel,AbstractHttp2StreamSinkChannel>
true
if the message was flushed, or false
if the result would blockIOException
- if an I/O error occursprotected void writeBeforeHeaderBlock(ByteBuffer buffer)
protected boolean isFlushRequiredOnEmptyBuffer()
public HeaderMap getHeaders()
protected void handleFlushComplete(boolean finalFrame)
handleFlushComplete
in class Http2StreamSinkChannel
protected void channelForciblyClosed() throws IOException
AbstractFramedStreamSinkChannel
channelForciblyClosed
in class Http2StreamSinkChannel
IOException
public ChannelListener<Http2DataStreamSinkChannel> getCompletionListener()
public void setCompletionListener(ChannelListener<Http2DataStreamSinkChannel> completionListener)
Copyright © 2021 JBoss by Red Hat. All rights reserved.