HttpMessage or an HttpContent into
a ByteBuf.
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final ByteBuf | |
| pack-priv static final int | |
| private static final float | |
| private static final float | |
| private float | headersEncodedSizeAccumulator
Used to calculate an exponential moving average of the encoded size of the initial line and the headers for a guess for future buffer allocations. |
| private final List | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private int | |
| private static final float | |
| private static final float | |
| private float | trailersEncodedSizeAccumulator
Used to calculate an exponential moving average of the encoded size of the trailers for a guess for future buffer allocations. |
| private static final byte[] | |
| private static final ByteBuf | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | acceptOutboundMessage(Object msg)
Overrides io. true if the given message should be handled.
|
| private static void | |
| private static boolean | |
| private static boolean | |
| protected void | encode(ChannelHandlerContext
the ctx, Object ChannelHandlerContext which this MessageToMessageEncoder belongs tothe message to encode to an other one msg, List<Object> the out)List into which the encoded msg should be added
needs to do some kind of aggregationImplements abstract io. |
| protected static void | |
| private void | encodeByteBufAndTrailers(int state, ChannelHandlerContext ctx, List<Object> out, ByteBuf content, HttpHeaders trailingHeaders)
|
| private void | |
| private void | encodeByteBufHttpContent(int state, ChannelHandlerContext ctx, ByteBuf buf, ByteBuf content, HttpHeaders trailingHeaders, List<Object> out)
|
| private void | encodeChunkedHttpContent(ChannelHandlerContext ctx, ByteBuf content, HttpHeaders trailingHeaders, List<Object> out)
|
| private static boolean | |
| private static void | |
| private static int | |
| private void | |
| private void | |
| protected void | |
| private void | |
| private void | |
| private void | |
| private ByteBuf | |
| protected abstract void | |
| private void | |
| private void | |
| private void | |
| private void | |
| protected boolean | Returns: true to signal the message has no contentthe message to test msg)Determine whether a message has a content or not. |
| private static int | Returns: ThereadableBytes with some additional padding.The readable bytes in the buffer. readableBytes)Add some additional overhead to the buffer. |
| protected void | sanitizeHeadersBeforeEncode(H msg, boolean isAlwaysEmpty)
Allows to sanitize headers of the message before encoding these. |
| private static void | |
| public void | write(ChannelHandlerContext
the ctx, Object ChannelHandlerContext for which the write operation is madethe message to write msg, ChannelPromise the promise)ChannelPromise to notify once the operation completesOverrides io. Implements io. ChannelHandlerContext#write(Object, ChannelPromise) to forward
to the next ChannelOutboundHandler in the ChannelPipeline.
|
| private static void | |
| private static void | |
| private static void |
| COPY_CONTENT_THRESHOLD | back to summary |
|---|---|
| private static final int COPY_CONTENT_THRESHOLD | |
| CRLF_BUF | back to summary |
|---|---|
| private static final ByteBuf CRLF_BUF | |
| CRLF_SHORT | back to summary |
|---|---|
| pack-priv static final int CRLF_SHORT | |
| HEADERS_WEIGHT_HISTORICAL | back to summary |
|---|---|
| private static final float HEADERS_WEIGHT_HISTORICAL | |
| HEADERS_WEIGHT_NEW | back to summary |
|---|---|
| private static final float HEADERS_WEIGHT_NEW | |
| headersEncodedSizeAccumulator | back to summary |
|---|---|
| private float headersEncodedSizeAccumulator Used to calculate an exponential moving average of the encoded size of the initial line and the headers for a guess for future buffer allocations. | |
| out | back to summary |
|---|---|
| private final List<Object> out | |
| ST_CONTENT_ALWAYS_EMPTY | back to summary |
|---|---|
| private static final int ST_CONTENT_ALWAYS_EMPTY | |
| ST_CONTENT_CHUNK | back to summary |
|---|---|
| private static final int ST_CONTENT_CHUNK | |
| ST_CONTENT_NON_CHUNK | back to summary |
|---|---|
| private static final int ST_CONTENT_NON_CHUNK | |
| ST_INIT | back to summary |
|---|---|
| private static final int ST_INIT | |
| state | back to summary |
|---|---|
private int state
| |
| TRAILERS_WEIGHT_HISTORICAL | back to summary |
|---|---|
| private static final float TRAILERS_WEIGHT_HISTORICAL | |
| TRAILERS_WEIGHT_NEW | back to summary |
|---|---|
| private static final float TRAILERS_WEIGHT_NEW | |
| trailersEncodedSizeAccumulator | back to summary |
|---|---|
| private float trailersEncodedSizeAccumulator Used to calculate an exponential moving average of the encoded size of the trailers for a guess for future buffer allocations. | |
| ZERO_CRLF_CRLF | back to summary |
|---|---|
| private static final byte[] ZERO_CRLF_CRLF | |
| ZERO_CRLF_CRLF_BUF | back to summary |
|---|---|
| private static final ByteBuf ZERO_CRLF_CRLF_BUF | |
| ZERO_CRLF_MEDIUM | back to summary |
|---|---|
| private static final int ZERO_CRLF_MEDIUM | |
| HttpObjectEncoder | back to summary |
|---|---|
| public HttpObjectEncoder() | |
| acceptOutboundMessage | back to summary |
|---|---|
| public boolean acceptOutboundMessage(Object msg) throws Exception Overrides io. Doc from io. Returns
| |
| addEncodedLengthHex | back to summary |
|---|---|
| private static void addEncodedLengthHex(ChannelHandlerContext ctx, long contentLength, List<Object> out) | |
| bypassEncoderIfEmpty | back to summary |
|---|---|
| private static boolean bypassEncoderIfEmpty(ByteBuf msg, List<Object> out) | |
| checkContentState | back to summary |
|---|---|
| private static boolean checkContentState(int state) | |
| encode | back to summary |
|---|---|
| protected void encode(ChannelHandlerContext ctx, Object msg, List<Object> out) throws Exception Implements abstract io. Doc from io. Encode from one message to an other. This method will be called for each written message that can be handled by this encoder.
| |
| encodeAscii | back to summary |
|---|---|
| protected static void encodeAscii(String s, ByteBuf buf)
Deprecated
| |
| encodeByteBufAndTrailers | back to summary |
|---|---|
| private void encodeByteBufAndTrailers(int state, ChannelHandlerContext ctx, List<Object> out, ByteBuf content, HttpHeaders trailingHeaders) | |
| encodeByteBufContent | back to summary |
|---|---|
| private void encodeByteBufContent(ChannelHandlerContext ctx, ByteBuf content, List<Object> out) | |
| encodeByteBufHttpContent | back to summary |
|---|---|
| private void encodeByteBufHttpContent(int state, ChannelHandlerContext ctx, ByteBuf buf, ByteBuf content, HttpHeaders trailingHeaders, List<Object> out) | |
| encodeChunkedHttpContent | back to summary |
|---|---|
| private void encodeChunkedHttpContent(ChannelHandlerContext ctx, ByteBuf content, HttpHeaders trailingHeaders, List<Object> out) | |
| encodeContentNonChunk | back to summary |
|---|---|
| private static boolean encodeContentNonChunk(List<Object> out, ByteBuf buf, ByteBuf content) | |
| encodedChunkedFileRegionContent | back to summary |
|---|---|
| private static void encodedChunkedFileRegionContent(ChannelHandlerContext ctx, FileRegion msg, List<Object> out) | |
| encodeEmptyLastHttpContent | back to summary |
|---|---|
| private static int encodeEmptyLastHttpContent(int state, List<Object> out) | |
| encodeFileRegionContent | back to summary |
|---|---|
| private void encodeFileRegionContent(ChannelHandlerContext ctx, FileRegion msg, List<Object> out) | |
| encodeFullHttpMessage | back to summary |
|---|---|
| private void encodeFullHttpMessage(ChannelHandlerContext ctx, Object o, List<Object> out) throws Exception | |
| encodeHeaders | back to summary |
|---|---|
| protected void encodeHeaders(HttpHeaders headers, ByteBuf buf) Encode the | |
| encodeHttpContent | back to summary |
|---|---|
| private void encodeHttpContent(ChannelHandlerContext ctx, HttpContent msg, List<Object> out) | |
| encodeHttpMessageLastContent | back to summary |
|---|---|
| private void encodeHttpMessageLastContent(ChannelHandlerContext ctx, H m, List<Object> out) throws Exception | |
| encodeHttpMessageNotLastContent | back to summary |
|---|---|
| private void encodeHttpMessageNotLastContent(ChannelHandlerContext ctx, H m, List<Object> out) throws Exception | |
| encodeInitHttpMessage | back to summary |
|---|---|
| private ByteBuf encodeInitHttpMessage(ChannelHandlerContext ctx, H m) throws Exception | |
| encodeInitialLine | back to summary |
|---|---|
| protected abstract void encodeInitialLine(ByteBuf buf, H message) throws Exception | |
| encodeJustHttpMessage | back to summary |
|---|---|
| private void encodeJustHttpMessage(ChannelHandlerContext ctx, H m, List<Object> out) throws Exception | |
| encodeLastHttpContent | back to summary |
|---|---|
| private void encodeLastHttpContent(ChannelHandlerContext ctx, LastHttpContent msg, List<Object> out) | |
| encodeNotHttpMessageContentTypes | back to summary |
|---|---|
private void encodeNotHttpMessageContentTypes(ChannelHandlerContext ctx, Object msg, List<Object> out)
| |
| encodeTrailingHeaders | back to summary |
|---|---|
| private void encodeTrailingHeaders(ChannelHandlerContext ctx, HttpHeaders trailingHeaders, List<Object> out) | |
| isContentAlwaysEmpty | back to summary |
|---|---|
| protected boolean isContentAlwaysEmpty(H msg) Determine whether a message has a content or not. Some message may have headers indicating a content without having an actual content, e.g the response to an HEAD or CONNECT request.
| |
| padSizeForAccumulation | back to summary |
|---|---|
| private static int padSizeForAccumulation(int readableBytes) Add some additional overhead to the buffer. The rational is that it is better to slightly over allocate and waste some memory, rather than under allocate and require a resize/copy.
| |
| sanitizeHeadersBeforeEncode | back to summary |
|---|---|
| protected void sanitizeHeadersBeforeEncode(H msg, boolean isAlwaysEmpty) Allows to sanitize headers of the message before encoding these. | |
| throwUnexpectedMessageTypeEx | back to summary |
|---|---|
| private static void throwUnexpectedMessageTypeEx(Object msg, int state) | |
| write | back to summary |
|---|---|
| public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception Overrides io. Implements io. Doc from io. Calls
| |
| writeOutList | back to summary |
|---|---|
| private static void writeOutList(ChannelHandlerContext ctx, List<Object> out, ChannelPromise promise) | |
| writePromiseCombiner | back to summary |
|---|---|
| private static void writePromiseCombiner(ChannelHandlerContext ctx, List<Object> out, ChannelPromise promise) | |
| writeVoidPromise | back to summary |
|---|---|
| private static void writeVoidPromise(ChannelHandlerContext ctx, List<Object> out) | |