private static void skipDynamicBlock(ByteArray input, int[] bitIndex) throws FormatException { // 3.2.7 Compression with dynamic Huffman codes (BTYPE=10) // Read 2 tables. One is a table to convert "code value of literal/length // alphabet" into "literal/length symbol". The other is a table to convert // "code value of distance alphabet" into "distance symbol". Huffman[] tables = new Huffman[2]; DeflateUtil.readDynamicTables(input, bitIndex, tables); skipData(input, bitIndex, tables[0], tables[1]); }
private static void skipFixedBlock(ByteArray input, int[] bitIndex) throws FormatException { // 3.2.6 Compression with fixed Huffman codes (BTYPE=01) // Inflate the compressed data using the pre-defined // conversion tables. The specification says in 3.2.2 // as follows. // // The only differences between the two compressed // cases is how the Huffman codes for the literal/ // length and distance alphabets are defined. // // The "two compressed cases" in the above sentence are // "fixed Huffman codes" and "dynamic Huffman codes". skipData(input, bitIndex, FixedLiteralLengthHuffman.getInstance(), FixedDistanceHuffman.getInstance()); }
private static void skipDynamicBlock(ByteArray input, int[] bitIndex) throws FormatException { // 3.2.7 Compression with dynamic Huffman codes (BTYPE=10) // Read 2 tables. One is a table to convert "code value of literal/length // alphabet" into "literal/length symbol". The other is a table to convert // "code value of distance alphabet" into "distance symbol". Huffman[] tables = new Huffman[2]; DeflateUtil.readDynamicTables(input, bitIndex, tables); skipData(input, bitIndex, tables[0], tables[1]); }
private static void skipFixedBlock(ByteArray input, int[] bitIndex) throws FormatException { // 3.2.6 Compression with fixed Huffman codes (BTYPE=01) // Inflate the compressed data using the pre-defined // conversion tables. The specification says in 3.2.2 // as follows. // // The only differences between the two compressed // cases is how the Huffman codes for the literal/ // length and distance alphabets are defined. // // The "two compressed cases" in the above sentence are // "fixed Huffman codes" and "dynamic Huffman codes". skipData(input, bitIndex, FixedLiteralLengthHuffman.getInstance(), FixedDistanceHuffman.getInstance()); }