Class FastLzFrameDecompressor
- java.lang.Object
-
- io.netty.handler.codec.compression.InputBufferingDecompressor
-
- io.netty.handler.codec.compression.FastLzFrameDecompressor
-
- All Implemented Interfaces:
Decompressor,java.lang.AutoCloseable
@UnstableApi public final class FastLzFrameDecompressor extends InputBufferingDecompressor
Uncompresses aByteBufencoded byFastLzFrameEncoderusing 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 Classes Modifier and Type Class Description static classFastLzFrameDecompressor.Builderprivate static classFastLzFrameDecompressor.StateCurrent state of decompression.-
Nested classes/interfaces inherited from interface io.netty.handler.codec.compression.Decompressor
Decompressor.AbstractDecompressorBuilder, Decompressor.Status
-
-
Field Summary
Fields Modifier and Type Field Description private ByteBufChecksumchecksumUnderlying checksum calculator in use.private intchunkLengthLength of the current received chunk of data.private intcurrentChecksumChecksum value of the current received chunk of data when present.private FastLzFrameDecompressor.StatecurrentStateprivate booleanhasChecksumIndicates whether this chunk has a checksum.private booleanisCompressedIndicates whether this chunk is compressed.private intoriginalLengthOriginal length of the current received chunk of data.-
Fields inherited from class io.netty.handler.codec.compression.InputBufferingDecompressor
allocator
-
-
Constructor Summary
Constructors Constructor Description FastLzFrameDecompressor(FastLzFrameDecompressor.Builder builder, ByteBufAllocator allocator)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FastLzFrameDecompressor.Builderbuilder()voidendOfInput()Notify 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.Decompressor.Statusstatus()Get the current status.-
Methods inherited from class io.netty.handler.codec.compression.InputBufferingDecompressor
addInput, available, close, takeOutput
-
-
-
-
Field Detail
-
currentState
private FastLzFrameDecompressor.State currentState
-
checksum
private final ByteBufChecksum checksum
Underlying checksum calculator in use.
-
chunkLength
private int chunkLength
Length of the current received chunk of data.
-
originalLength
private int originalLength
Original length of the current received chunk of data. It is equal tochunkLengthfor uncompressed chunks.
-
isCompressed
private boolean isCompressed
Indicates whether this chunk is compressed.
-
hasChecksum
private boolean hasChecksum
Indicates whether this chunk has a checksum.
-
currentChecksum
private int currentChecksum
Checksum value of the current received chunk of data when present.
-
-
Constructor Detail
-
FastLzFrameDecompressor
FastLzFrameDecompressor(FastLzFrameDecompressor.Builder builder, ByteBufAllocator allocator)
-
-
Method Detail
-
processInput
void processInput(ByteBuf buf) throws DecompressionException
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
public Decompressor.Status status() throws DecompressionException
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
public void endOfInput() throws DecompressionExceptionDescription 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
ByteBuf processOutput(ByteBuf in) throws DecompressionException
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
@UnstableApi public static FastLzFrameDecompressor.Builder builder()
-
-