37 |
|
|
38 |
package java.util.zip; |
package java.util.zip; |
39 |
|
|
40 |
public class InflaterHuffmanTree |
class InflaterHuffmanTree |
41 |
{ |
{ |
42 |
private static final int MAX_BITLEN = 15; |
private static final int MAX_BITLEN = 15; |
43 |
|
|
44 |
private short[] tree; |
private short[] tree; |
45 |
|
|
46 |
public static InflaterHuffmanTree defLitLenTree, defDistTree; |
static InflaterHuffmanTree defLitLenTree, defDistTree; |
47 |
|
|
48 |
static |
static |
49 |
{ |
{ |
79 |
* |
* |
80 |
* @param codeLengths the array of code lengths |
* @param codeLengths the array of code lengths |
81 |
*/ |
*/ |
82 |
public InflaterHuffmanTree(byte[] codeLengths) throws DataFormatException |
InflaterHuffmanTree(byte[] codeLengths) throws DataFormatException |
83 |
{ |
{ |
84 |
buildTree(codeLengths); |
buildTree(codeLengths); |
85 |
} |
} |
168 |
* @param input the input source. |
* @param input the input source. |
169 |
* @return the next symbol, or -1 if not enough input is available. |
* @return the next symbol, or -1 if not enough input is available. |
170 |
*/ |
*/ |
171 |
public int getSymbol(StreamManipulator input) throws DataFormatException |
int getSymbol(StreamManipulator input) throws DataFormatException |
172 |
{ |
{ |
173 |
int lookahead, symbol; |
int lookahead, symbol; |
174 |
if ((lookahead = input.peekBits(9)) >= 0) |
if ((lookahead = input.peekBits(9)) >= 0) |