Package io.netty.handler.codec.http
Class HttpContentDecompressor
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.handler.codec.MessageToMessageDecoder<HttpObject>
io.netty.handler.codec.http.HttpContentDecoder
io.netty.handler.codec.http.HttpContentDecompressor
- All Implemented Interfaces:
ChannelHandler
,ChannelInboundHandler
Decompresses an
HttpMessage
and an HttpContent
compressed in
gzip
or deflate
encoding. For more information on how this
handler modifies the message, please refer to HttpContentDecoder
.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
ChannelHandler.Sharable
-
Field Summary
FieldsFields inherited from class io.netty.handler.codec.http.HttpContentDecoder
ctx, IDENTITY
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a newHttpContentDecompressor
in non-strict mode.HttpContentDecompressor
(boolean strict) Create a newHttpContentDecompressor
. -
Method Summary
Modifier and TypeMethodDescriptionprotected EmbeddedChannel
newContentDecoder
(String contentEncoding) Returns a newEmbeddedChannel
that decodes the HTTP message content encoded in the specified contentEncoding.Methods inherited from class io.netty.handler.codec.http.HttpContentDecoder
channelInactive, channelReadComplete, decode, getTargetContentEncoding, handlerAdded, handlerRemoved
Methods inherited from class io.netty.handler.codec.MessageToMessageDecoder
acceptInboundMessage, channelRead
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, isSharable
-
Field Details
-
strict
private final boolean strict
-
-
Constructor Details
-
HttpContentDecompressor
public HttpContentDecompressor()Create a newHttpContentDecompressor
in non-strict mode. -
HttpContentDecompressor
public HttpContentDecompressor(boolean strict) Create a newHttpContentDecompressor
.- Parameters:
strict
- iftrue
use strict handling of deflate if used, otherwise handle it in a more lenient fashion.
-
-
Method Details
-
newContentDecoder
Description copied from class:HttpContentDecoder
Returns a newEmbeddedChannel
that decodes the HTTP message content encoded in the specified contentEncoding.- Specified by:
newContentDecoder
in classHttpContentDecoder
- Parameters:
contentEncoding
- the value of the"Content-Encoding"
header- Returns:
- a new
EmbeddedChannel
if the specified encoding is supported.null
otherwise (alternatively, you can throw an exception to block unknown encoding). - Throws:
Exception
-