HttpMessage or an HttpContent into
a Buffer.
| Modifier and Type | Field and Description |
|---|---|
| private static final byte[] | |
| pack-priv static final short | |
| private Supplier | |
| 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 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 int | |
| private Supplier |
| 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 long | |
| protected Buffer | |
| private static Object | |
| protected void | encodeAndClose(ChannelHandlerContext
the ctx, Object ChannelHandlerContext which this MessageToMessageEncoder belongs to.the message to encode to another one. msg, List<Object> the out)List into which produced output messages should be added.Overrides io. |
| private void | |
| protected void | |
| protected abstract 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. |
| protected Buffer |
| CRLF | back to summary |
|---|---|
| private static final byte[] CRLF | |
| CRLF_SHORT | back to summary |
|---|---|
| pack-priv static final short CRLF_SHORT | |
| crlfBufferSupplier | back to summary |
|---|---|
| private Supplier<Buffer> crlfBufferSupplier | |
| 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. | |
| 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_MEDIUM | back to summary |
|---|---|
| private static final int ZERO_CRLF_MEDIUM | |
| zeroCrlfCrlfBufferSupplier | back to summary |
|---|---|
| private Supplier<Buffer> zeroCrlfCrlfBufferSupplier | |
| HttpObjectEncoder | back to summary |
|---|---|
| public HttpObjectEncoder() | |
| acceptOutboundMessage | back to summary |
|---|---|
| public boolean acceptOutboundMessage(Object msg) throws Exception Overrides io. Doc from io. Returns
| |
| contentLength | back to summary |
|---|---|
| private static long contentLength(Object msg) | |
| crlfBuffer | back to summary |
|---|---|
| protected Buffer crlfBuffer(BufferAllocator allocator) | |
| encode | back to summary |
|---|---|
| private static Object encode(Object msg) | |
| encodeAndClose | back to summary |
|---|---|
| protected void encodeAndClose(ChannelHandlerContext ctx, Object msg, List<Object> out) throws Exception Overrides io. Doc from io. Encode from one message to another. This method will be called for each written message that can be handled by this encoder. The message will not be automatically disposed of after this call. Instead, the responsibility of ensuring that messages are disposed of falls upon the implementor of this method.
Subclasses that wish to have incoming messages automatically disposed of should instead override the
| |
| encodeChunkedContent | back to summary |
|---|---|
| private void encodeChunkedContent(ChannelHandlerContext ctx, Object msg, long contentLength, List<Object> out) | |
| encodeHeaders | back to summary |
|---|---|
| protected void encodeHeaders(HttpHeaders headers, Buffer buf) Encode the | |
| encodeInitialLine | back to summary |
|---|---|
| protected abstract void encodeInitialLine(Buffer buf, H message) throws Exception | |
| 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. | |
| zeroCrlfCrlfBuffer | back to summary |
|---|---|
| protected Buffer zeroCrlfCrlfBuffer(BufferAllocator allocator) | |