Class HttpContentDecoder

All Implemented Interfaces:
ChannelHandler, ChannelInboundHandler
Direct Known Subclasses:
HttpContentDecompressor

public abstract class HttpContentDecoder extends MessageToMessageDecoder<HttpObject>
Decodes the content of the received HttpRequest and HttpContent. The original content is replaced with the new content decoded by the EmbeddedChannel, which is created by newContentDecoder(String). Once decoding is finished, the value of the 'Content-Encoding' header is set to the target content encoding, as returned by getTargetContentEncoding(String). Also, the 'Content-Length' header is updated to the length of the decoded content. If the content encoding of the original is not supported by the decoder, newContentDecoder(String) should return null so that no decoding occurs (i.e. pass-through).

Please note that this is an abstract class. You have to extend this class and implement newContentDecoder(String) properly to make this class functional. For example, refer to the source code of HttpContentDecompressor.

This handler must be placed after HttpObjectDecoder in the pipeline so that this handler can intercept HTTP requests after HttpObjectDecoder converts ByteBufs into HTTP requests.