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
public class HttpContentDecompressor extends HttpContentDecoder
Decompresses anHttpMessageand anHttpContentcompressed ingzipordeflateencoding. For more information on how this handler modifies the message, please refer toHttpContentDecoder.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
ChannelHandler.Sharable
-
-
Field Summary
-
Fields inherited from class io.netty.handler.codec.http.HttpContentDecoder
ctx
-
-
Constructor Summary
Constructors Constructor Description HttpContentDecompressor()Deprecated.HttpContentDecompressor(boolean strict)Deprecated.HttpContentDecompressor(boolean strict, int maxAllocation)Create a newHttpContentDecompressor.HttpContentDecompressor(int maxAllocation)Create a newHttpContentDecompressorin non-strict mode.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected EmbeddedChannelnewContentDecoder(java.lang.String contentEncoding)Returns a newEmbeddedChannelthat 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
-
-
-
-
Constructor Detail
-
HttpContentDecompressor
@Deprecated public HttpContentDecompressor()
Deprecated.Create a newHttpContentDecompressorin non-strict mode.
-
HttpContentDecompressor
public HttpContentDecompressor(int maxAllocation)
Create a newHttpContentDecompressorin non-strict mode.- Parameters:
maxAllocation- Maximum size of the decompression buffer. Must be >= 0. If zero, maximum size is not limited.
-
HttpContentDecompressor
@Deprecated public HttpContentDecompressor(boolean strict)
Deprecated.Create a newHttpContentDecompressor.- Parameters:
strict- iftrueuse strict handling of deflate if used, otherwise handle it in a more lenient fashion.
-
HttpContentDecompressor
public HttpContentDecompressor(boolean strict, int maxAllocation)Create a newHttpContentDecompressor.- Parameters:
strict- iftrueuse strict handling of deflate if used, otherwise handle it in a more lenient fashion.maxAllocation- Maximum size of the decompression buffer. Must be >= 0. If zero, maximum size is not limited.
-
-
Method Detail
-
newContentDecoder
protected EmbeddedChannel newContentDecoder(java.lang.String contentEncoding) throws java.lang.Exception
Description copied from class:HttpContentDecoderReturns a newEmbeddedChannelthat decodes the HTTP message content encoded in the specified contentEncoding.- Specified by:
newContentDecoderin classHttpContentDecoder- Parameters:
contentEncoding- the value of the"Content-Encoding"header- Returns:
- a new
EmbeddedChannelif the specified encoding is supported.nullotherwise (alternatively, you can throw an exception to block unknown encoding). - Throws:
java.lang.Exception
-
-