Class FastLzFrameDecompressor
java.lang.Object
io.netty.handler.codec.compression.InputBufferingDecompressor
io.netty.handler.codec.compression.FastLzFrameDecompressor
- All Implemented Interfaces:
Decompressor, AutoCloseable
Uncompresses a
ByteBuf encoded by FastLzFrameEncoder using the FastLZ algorithm.
See FastLZ format.
This API is still in progress as part of the decompression migration tracked by #16743.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classprivate static enumCurrent state of decompression.Nested classes/interfaces inherited from interface Decompressor
Decompressor.AbstractDecompressorBuilder, Decompressor.Status -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ByteBufChecksumUnderlying checksum calculator in use.private intLength of the current received chunk of data.private intChecksum value of the current received chunk of data when present.private FastLzFrameDecompressor.Stateprivate booleanIndicates whether this chunk has a checksum.private booleanIndicates whether this chunk is compressed.private intOriginal length of the current received chunk of data.Fields inherited from class InputBufferingDecompressor
allocator -
Constructor Summary
ConstructorsConstructorDescriptionFastLzFrameDecompressor(FastLzFrameDecompressor.Builder builder, ByteBufAllocator allocator) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()voidNotify the decompressor that the end of input has been reached.(package private) voidprocessInput(ByteBuf buf) Process some input.(package private) ByteBufprocessOutput(ByteBuf in) Produce some output.status()Get the current status.Methods inherited from class InputBufferingDecompressor
addInput, available, close, takeOutput
-
Field Details
-
currentState
-
checksum
Underlying checksum calculator in use. -
chunkLength
private int chunkLengthLength of the current received chunk of data. -
originalLength
private int originalLengthOriginal length of the current received chunk of data. It is equal tochunkLengthfor uncompressed chunks. -
isCompressed
private boolean isCompressedIndicates whether this chunk is compressed. -
hasChecksum
private boolean hasChecksumIndicates whether this chunk has a checksum. -
currentChecksum
private int currentChecksumChecksum value of the current received chunk of data when present.
-
-
Constructor Details
-
FastLzFrameDecompressor
FastLzFrameDecompressor(FastLzFrameDecompressor.Builder builder, ByteBufAllocator allocator)
-
-
Method Details
-
processInput
Description copied from class:InputBufferingDecompressorProcess some input. The input buffer ownership does not transfer to this method: If there's still data unread after this method finishes, it will be buffered.- Specified by:
processInputin classInputBufferingDecompressor- Parameters:
buf- The input buffer- Throws:
DecompressionException
-
status
Description copied from interface:DecompressorGet the current status. Like the other operations on this class, calling this method is not permitted if the decompressor has failed or was closed.- Returns:
- The current status
- Throws:
DecompressionException
-
endOfInput
Description copied from interface:DecompressorNotify the decompressor that the end of input has been reached. Some implementations may flush remaining data or throw an exception if the input is truncated, but most implementations do nothing. Only permitted forDecompressor.Status.NEED_INPUT.- Throws:
DecompressionException
-
processOutput
Description copied from class:InputBufferingDecompressorProduce some output. The input buffer parameter may be read from to consume some more data, but note that this method must return a buffer even if the input is too short.- Specified by:
processOutputin classInputBufferingDecompressor- Parameters:
in- The input buffer- Throws:
DecompressionException
-
builder
-