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.ObjectAPI for Brotli decompression.
-
-
Field Summary
Fields Modifier and Type Field Description private static int[]CODE_LENGTH_CODE_ORDERprivate static intCODE_LENGTH_CODESprivate static intCODE_LENGTH_REPEAT_CODEprivate static intDEFAULT_CODE_LENGTHprivate static intDISTANCE_CONTEXT_BITSprivate static int[]DISTANCE_SHORT_CODE_INDEX_OFFSETprivate static int[]DISTANCE_SHORT_CODE_VALUE_OFFSETprivate static int[]FIXED_TABLEStatic Huffman code for the code length code lengths.private static intHUFFMAN_TABLE_BITSprivate static intHUFFMAN_TABLE_MASKprivate static intLITERAL_CONTEXT_BITSprivate static intNUM_BLOCK_LENGTH_CODESprivate static intNUM_DISTANCE_SHORT_CODESprivate static intNUM_INSERT_AND_COPY_CODESprivate static intNUM_LITERAL_CODES
-
Constructor Summary
Constructors Constructor Description Decode()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static voidcopyUncompressedData(State state)private static voiddecodeBlockTypeAndLength(State state, int treeType)private static voiddecodeCommandBlockSwitch(State state)private static intdecodeContextMap(int contextMapSize, byte[] contextMap, BitReader br)private static voiddecodeDistanceBlockSwitch(State state)private static voiddecodeLiteralBlockSwitch(State state)private static voiddecodeMetaBlockLength(BitReader br, State state)private static intdecodeVarLenUnsignedByte(BitReader br)Decodes a number in the range [0..255], by reading 1 - 11 bits.(package private) static voiddecompress(State state)Actual decompress implementation.private static voidinverseMoveToFrontTransform(byte[] v, int vLen)private static voidmaybeReallocateRingBuffer(State state)private static voidmoveToFront(int[] v, int index)private static intreadBlockLength(int[] table, int offset, BitReader br)(package private) static voidreadHuffmanCode(int alphabetSize, int[] table, int offset, BitReader br)private static voidreadHuffmanCodeLengths(int[] codeLengthCodeLengths, int numSymbols, int[] codeLengths, BitReader br)private static voidreadMetablockHuffmanCodesAndContextMaps(State state)private static voidreadMetablockInfo(State state)Reads next metablock header.private static intreadSymbol(int[] table, int offset, BitReader br)Decodes the next Huffman code from bit-stream.(package private) static voidsetCustomDictionary(State state, byte[] data)private static inttranslateShortCodes(int code, int[] ringBuffer, int index)private static booleanwriteRingBuffer(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.
-
-