public class ByteBufBackedChannelOutboundInvokingHttpContentOutputStream extends AbstractByteBufBackedChannelOutboundInvokingOutputStream<HttpContent>
AbstractByteBufBackedChannelOutboundInvokingOutputStream
that writes HttpContent
messages.createMessage(ByteBuf)
,
createLastMessage()
AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator
channelOutboundInvoker, closeChannelOutboundInvoker
Constructor and Description |
---|
ByteBufBackedChannelOutboundInvokingHttpContentOutputStream(ChannelOutboundInvoker channelOutboundInvoker,
boolean closeChannelOutboundInvoker)
Creates a new
ByteBufBackedChannelOutboundInvokingHttpContentOutputStream . |
ByteBufBackedChannelOutboundInvokingHttpContentOutputStream(ChannelOutboundInvoker channelOutboundInvoker,
int flushThreshold,
boolean closeChannelOutboundInvoker,
AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator byteBufCreator)
Creates a new
ByteBufBackedChannelOutboundInvokingHttpContentOutputStream . |
Modifier and Type | Method and Description |
---|---|
protected HttpContent |
createLastMessage()
Returns a new
DefaultLastHttpContent when invoked. |
protected HttpContent |
createMessage(ByteBuf content)
|
createMessage
close, createMessage, flush, getFlushThreshold, newPromise, write, write, write
public ByteBufBackedChannelOutboundInvokingHttpContentOutputStream(ChannelOutboundInvoker channelOutboundInvoker, boolean closeChannelOutboundInvoker)
ByteBufBackedChannelOutboundInvokingHttpContentOutputStream
.channelOutboundInvoker
- the ChannelOutboundInvoker
to which operations are adapted; must not be null
closeChannelOutboundInvoker
- whether ChannelOutboundInvoker.close(ChannelPromise)
will be called on
the supplied ChannelOutboundInvoker
when close()
is calledByteBufBackedChannelOutboundInvokingHttpContentOutputStream(ChannelOutboundInvoker,
int, boolean,
AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator)
public ByteBufBackedChannelOutboundInvokingHttpContentOutputStream(ChannelOutboundInvoker channelOutboundInvoker, int flushThreshold, boolean closeChannelOutboundInvoker, AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator byteBufCreator)
ByteBufBackedChannelOutboundInvokingHttpContentOutputStream
.channelOutboundInvoker
- the ChannelOutboundInvoker
to which operations are adapted; must not be null
flushThreshold
- the minimum number of bytes that this
instance has to write
before an automatic flush will take place;
if less than 0
0
will be used instead; if Integer#MAX_VALUE
then no automatic flushing will occurcloseChannelOutboundInvoker
- whether ChannelOutboundInvoker.close(ChannelPromise)
will be called on
the supplied ChannelOutboundInvoker
when close()
is calledbyteBufCreator
- a ByteBufCreator
that will be used
to create
ByteBuf
instances; may be null
in which
case a default ByteBufCreator
adapting Unpooled.wrappedBuffer(byte[], int, int)
will be
used insteadprotected HttpContent createMessage(ByteBuf content)
DefaultHttpContent
whose content()
method returns the
supplied ByteBuf
.
This method never returns null
.
createMessage
in class AbstractByteBufBackedChannelOutboundInvokingOutputStream<HttpContent>
content
- a ByteBuf
; must not be null
DefaultHttpContent
whose content()
method returns the
supplied ByteBuf
; never null
AbstractByteBufBackedChannelOutboundInvokingOutputStream.createMessage(byte[], int, int)
protected HttpContent createLastMessage()
DefaultLastHttpContent
when invoked.
This method never returns null
.
createLastMessage
in class AbstractChannelOutboundInvokingOutputStream<HttpContent>
DefaultLastHttpContent
AbstractChannelOutboundInvokingOutputStream.close()
Copyright © 2019–2020, microBean™. All rights reserved.