Class ZstdDecoder
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.handler.codec.ByteToMessageDecoder
io.netty.handler.codec.compression.ZstdDecoder
- All Implemented Interfaces:
ChannelHandler, ChannelInboundHandler
-
Nested Class Summary
Nested classes/interfaces inherited from class ByteToMessageDecoder
ByteToMessageDecoder.CumulatorNested classes/interfaces inherited from interface ChannelHandler
ChannelHandler.Sharable -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault upper bound on theWindow_Logaccepted by the decoder.static final intDefault maximum size of a single output buffer, in bytes (4 MiB).Fields inherited from class ByteToMessageDecoder
COMPOSITE_CUMULATOR, MERGE_CUMULATOR -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new decoder with theDEFAULT_MAXIMUM_ALLOCATION_SIZE, and theDEFAULT_MAX_WINDOW_LOGwindow log size.ZstdDecoder(int maximumAllocationSize) Creates a new decoder with the given maximum allocation size, and theDEFAULT_MAX_WINDOW_LOGwindow log size.ZstdDecoder(int maximumAllocationSize, int maxWindowLog) Creates a new decoder with an explicit upper bound on the acceptedWindow_Log. -
Method Summary
Modifier and TypeMethodDescriptionvoidCallsChannelHandlerContext.fireChannelReadComplete()to forward to the nextChannelInboundHandlerin theChannelPipeline.protected voiddecode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) Decode the from oneByteBufto an other.voidDo nothing by default, sub-classes may override this method.protected voidGets called after theByteToMessageDecoderwas removed from the actual context and it doesn't handle events anymore.Methods inherited from class ByteToMessageDecoder
actualReadableBytes, callDecode, channelInactive, channelRead, decodeLast, discardSomeReadBytes, handlerRemoved, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggeredMethods inherited from class ChannelInboundHandlerAdapter
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaughtMethods inherited from class ChannelHandlerAdapter
ensureNotSharable, isSharable
-
Field Details
-
DEFAULT_MAXIMUM_ALLOCATION_SIZE
public static final int DEFAULT_MAXIMUM_ALLOCATION_SIZEDefault maximum size of a single output buffer, in bytes (4 MiB).- See Also:
-
DEFAULT_MAX_WINDOW_LOG
public static final int DEFAULT_MAX_WINDOW_LOGDefault upper bound on theWindow_Logaccepted by the decoder.27corresponds to a 128 MiB decompression window.- See Also:
-
-
Constructor Details
-
ZstdDecoder
public ZstdDecoder()Creates a new decoder with theDEFAULT_MAXIMUM_ALLOCATION_SIZE, and theDEFAULT_MAX_WINDOW_LOGwindow log size.The window log size bounds the memory usage of the sliding window for ZSTD frame decompression. Frames declaring a larger window will be rejected to bound the memory the decoder may allocate per stream.
-
ZstdDecoder
public ZstdDecoder(int maximumAllocationSize) Creates a new decoder with the given maximum allocation size, and theDEFAULT_MAX_WINDOW_LOGwindow log size.The window log size bounds the memory usage of the sliding window for ZSTD frame decompression. Frames declaring a larger window will be rejected to bound the memory the decoder may allocate per stream.
- Parameters:
maximumAllocationSize- maximum size of a single output buffer.
-
ZstdDecoder
public ZstdDecoder(int maximumAllocationSize, int maxWindowLog) Creates a new decoder with an explicit upper bound on the acceptedWindow_Log.- Parameters:
maximumAllocationSize- maximum size of a single output buffer.maxWindowLog- upper bound on theWindow_Logfield of incoming frames; must be in[10, 31]. Frames declaring a larger window will be rejected to bound the memory the decoder may allocate per stream.
-
-
Method Details
-
decode
Description copied from class:ByteToMessageDecoderDecode the from oneByteBufto an other. This method will be called till either the inputByteBufhas nothing to read when return from this method or till nothing was read from the inputByteBuf.- Specified by:
decodein classByteToMessageDecoder- Parameters:
ctx- theChannelHandlerContextwhich thisByteToMessageDecoderbelongs toin- theByteBuffrom which to read dataout- theListto which decoded messages should be added- Throws:
Exception- is thrown if an error occurs
-
channelReadComplete
Description copied from class:ChannelInboundHandlerAdapterCallsChannelHandlerContext.fireChannelReadComplete()to forward to the nextChannelInboundHandlerin theChannelPipeline. Sub-classes may override this method to change behavior.- Specified by:
channelReadCompletein interfaceChannelInboundHandler- Overrides:
channelReadCompletein classByteToMessageDecoder- Throws:
Exception
-
handlerAdded
Description copied from class:ChannelHandlerAdapterDo nothing by default, sub-classes may override this method.- Specified by:
handlerAddedin interfaceChannelHandler- Overrides:
handlerAddedin classChannelHandlerAdapter- Throws:
Exception
-
handlerRemoved0
Description copied from class:ByteToMessageDecoderGets called after theByteToMessageDecoderwas removed from the actual context and it doesn't handle events anymore.- Overrides:
handlerRemoved0in classByteToMessageDecoder- Throws:
Exception
-