- java.lang.Object
-
- io.netty5.channel.ChannelHandlerAdapter
-
- io.netty5.handler.codec.MessageToMessageDecoder<HttpObject>
-
- io.netty5.handler.codec.http.HttpContentDecoder
-
- io.netty5.handler.codec.http.HttpContentDecompressor
-
- All Implemented Interfaces:
ChannelHandler
public class HttpContentDecompressor extends HttpContentDecoder
Decompresses anHttpMessageand anHttpContentcompressed ingzipordeflateencoding. For more information on how this handler modifies the message, please refer toHttpContentDecoder.
-
-
Field Summary
-
Fields inherited from class io.netty5.handler.codec.http.HttpContentDecoder
ctx
-
-
Constructor Summary
Constructors Constructor Description HttpContentDecompressor()Create a newHttpContentDecompressorin non-strict mode.HttpContentDecompressor(boolean strict)Create a newHttpContentDecompressor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DecompressornewContentDecoder(String contentEncoding)Returns a newDecompressorthat decodes the HTTP message content encoded in the specified contentEncoding.-
Methods inherited from class io.netty5.handler.codec.http.HttpContentDecoder
channelInactive, channelReadComplete, decodeAndClose, getTargetContentEncoding, handlerAdded, handlerRemoved
-
Methods inherited from class io.netty5.handler.codec.MessageToMessageDecoder
acceptInboundMessage, channelRead, decode
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty5.channel.ChannelHandler
bind, channelActive, channelExceptionCaught, channelInboundEvent, channelRegistered, channelShutdown, channelUnregistered, channelWritabilityChanged, close, connect, deregister, disconnect, flush, isSharable, pendingOutboundBytes, read, register, sendOutboundEvent, shutdown, write
-
-
-
-
Constructor Detail
-
HttpContentDecompressor
public HttpContentDecompressor()
Create a newHttpContentDecompressorin non-strict mode.
-
HttpContentDecompressor
public HttpContentDecompressor(boolean strict)
Create a newHttpContentDecompressor.- Parameters:
strict- iftrueuse strict handling of deflate if used, otherwise handle it in a more lenient fashion.
-
-
Method Detail
-
newContentDecoder
protected Decompressor newContentDecoder(String contentEncoding) throws Exception
Description copied from class:HttpContentDecoderReturns a newDecompressorthat 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
Decompressorif the specified encoding is supported.nullotherwise (alternatively, you can throw an exception to block unknown encoding). - Throws:
Exception
-
-