Class Decode


  • final class Decode
    extends java.lang.Object
    API for Brotli decompression.
    • Field Detail

      • CODE_LENGTH_REPEAT_CODE

        private static final int CODE_LENGTH_REPEAT_CODE
        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
      • 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.
    • Constructor Detail

      • Decode

        Decode()
    • Method Detail

      • decodeVarLenUnsignedByte

        private static int decodeVarLenUnsignedByte​(BitReader br)
        Decodes a number in the range [0..255], by reading 1 - 11 bits.
      • decodeMetaBlockLength

        private static void decodeMetaBlockLength​(BitReader br,
                                                  State state)
      • 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.