Package com.itextpdf.io.codec.brotli.dec
Class Decode
- java.lang.Object
-
- com.itextpdf.io.codec.brotli.dec.Decode
-
final class Decode extends java.lang.Object
API for Brotli decompression.
-
-
Field Summary
Fields Modifier and Type Field Description private static int[]
CODE_LENGTH_CODE_ORDER
private static int
CODE_LENGTH_CODES
private static int
CODE_LENGTH_REPEAT_CODE
private static int
DEFAULT_CODE_LENGTH
private static int
DISTANCE_CONTEXT_BITS
private static int[]
DISTANCE_SHORT_CODE_INDEX_OFFSET
private static int[]
DISTANCE_SHORT_CODE_VALUE_OFFSET
private static int[]
FIXED_TABLE
Static Huffman code for the code length code lengths.private static int
HUFFMAN_TABLE_BITS
private static int
HUFFMAN_TABLE_MASK
private static int
LITERAL_CONTEXT_BITS
private static int
NUM_BLOCK_LENGTH_CODES
private static int
NUM_DISTANCE_SHORT_CODES
private static int
NUM_INSERT_AND_COPY_CODES
private static int
NUM_LITERAL_CODES
-
Constructor Summary
Constructors Constructor Description Decode()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static void
copyUncompressedData(State state)
private static void
decodeBlockTypeAndLength(State state, int treeType)
private static void
decodeCommandBlockSwitch(State state)
private static int
decodeContextMap(int contextMapSize, byte[] contextMap, BitReader br)
private static void
decodeDistanceBlockSwitch(State state)
private static void
decodeLiteralBlockSwitch(State state)
private static void
decodeMetaBlockLength(BitReader br, State state)
private static int
decodeVarLenUnsignedByte(BitReader br)
Decodes a number in the range [0..255], by reading 1 - 11 bits.(package private) static void
decompress(State state)
Actual decompress implementation.private static void
inverseMoveToFrontTransform(byte[] v, int vLen)
private static void
maybeReallocateRingBuffer(State state)
private static void
moveToFront(int[] v, int index)
private static int
readBlockLength(int[] table, int offset, BitReader br)
(package private) static void
readHuffmanCode(int alphabetSize, int[] table, int offset, BitReader br)
private static void
readHuffmanCodeLengths(int[] codeLengthCodeLengths, int numSymbols, int[] codeLengths, BitReader br)
private static void
readMetablockHuffmanCodesAndContextMaps(State state)
private static void
readMetablockInfo(State state)
Reads next metablock header.private static int
readSymbol(int[] table, int offset, BitReader br)
Decodes the next Huffman code from bit-stream.(package private) static void
setCustomDictionary(State state, byte[] data)
private static int
translateShortCodes(int code, int[] ringBuffer, int index)
private static boolean
writeRingBuffer(State state)
-
-
-
Field Detail
-
DEFAULT_CODE_LENGTH
private static final int DEFAULT_CODE_LENGTH
- See Also:
- Constant Field Values
-
CODE_LENGTH_REPEAT_CODE
private static final int CODE_LENGTH_REPEAT_CODE
- See Also:
- Constant Field Values
-
NUM_LITERAL_CODES
private static final int NUM_LITERAL_CODES
- See Also:
- Constant Field Values
-
NUM_INSERT_AND_COPY_CODES
private static final int NUM_INSERT_AND_COPY_CODES
- See Also:
- Constant Field Values
-
NUM_BLOCK_LENGTH_CODES
private static final int NUM_BLOCK_LENGTH_CODES
- See Also:
- Constant Field Values
-
LITERAL_CONTEXT_BITS
private static final int LITERAL_CONTEXT_BITS
- See Also:
- Constant Field Values
-
DISTANCE_CONTEXT_BITS
private static final int DISTANCE_CONTEXT_BITS
- See Also:
- Constant Field Values
-
HUFFMAN_TABLE_BITS
private static final int HUFFMAN_TABLE_BITS
- See Also:
- Constant Field Values
-
HUFFMAN_TABLE_MASK
private static final int HUFFMAN_TABLE_MASK
- See Also:
- Constant Field Values
-
CODE_LENGTH_CODES
private static final int CODE_LENGTH_CODES
- See Also:
- Constant Field Values
-
CODE_LENGTH_CODE_ORDER
private static final int[] CODE_LENGTH_CODE_ORDER
-
NUM_DISTANCE_SHORT_CODES
private static final int NUM_DISTANCE_SHORT_CODES
- See Also:
- Constant Field Values
-
DISTANCE_SHORT_CODE_INDEX_OFFSET
private static final int[] DISTANCE_SHORT_CODE_INDEX_OFFSET
-
DISTANCE_SHORT_CODE_VALUE_OFFSET
private static final int[] DISTANCE_SHORT_CODE_VALUE_OFFSET
-
FIXED_TABLE
private static final int[] FIXED_TABLE
Static Huffman code for the code length code lengths.
-
-
Method Detail
-
decodeVarLenUnsignedByte
private static int decodeVarLenUnsignedByte(BitReader br)
Decodes a number in the range [0..255], by reading 1 - 11 bits.
-
readSymbol
private static int readSymbol(int[] table, int offset, BitReader br)
Decodes the next Huffman code from bit-stream.
-
readBlockLength
private static int readBlockLength(int[] table, int offset, BitReader br)
-
translateShortCodes
private static int translateShortCodes(int code, int[] ringBuffer, int index)
-
moveToFront
private static void moveToFront(int[] v, int index)
-
inverseMoveToFrontTransform
private static void inverseMoveToFrontTransform(byte[] v, int vLen)
-
readHuffmanCodeLengths
private static void readHuffmanCodeLengths(int[] codeLengthCodeLengths, int numSymbols, int[] codeLengths, BitReader br)
-
readHuffmanCode
static void readHuffmanCode(int alphabetSize, int[] table, int offset, BitReader br)
-
decodeContextMap
private static int decodeContextMap(int contextMapSize, byte[] contextMap, BitReader br)
-
decodeBlockTypeAndLength
private static void decodeBlockTypeAndLength(State state, int treeType)
-
decodeLiteralBlockSwitch
private static void decodeLiteralBlockSwitch(State state)
-
decodeCommandBlockSwitch
private static void decodeCommandBlockSwitch(State state)
-
decodeDistanceBlockSwitch
private static void decodeDistanceBlockSwitch(State state)
-
maybeReallocateRingBuffer
private static void maybeReallocateRingBuffer(State state)
-
readMetablockInfo
private static void readMetablockInfo(State state)
Reads next metablock header.- Parameters:
state
- decoding state
-
readMetablockHuffmanCodesAndContextMaps
private static void readMetablockHuffmanCodesAndContextMaps(State state)
-
copyUncompressedData
private static void copyUncompressedData(State state)
-
writeRingBuffer
private static boolean writeRingBuffer(State state)
-
setCustomDictionary
static void setCustomDictionary(State state, byte[] data)
-
decompress
static void decompress(State state)
Actual decompress implementation.
-
-