Package org.h2.dev.util
Class BitStream.Huffman
java.lang.Object
org.h2.dev.util.BitStream.Huffman
- Enclosing class:
- BitStream
A Huffman code.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetBitCount(int value) Get the number of bits of the Huffman code for this value.intread(BitStream.In in) Read a value.voidwrite(BitStream.Out out, int value) Write a value.
-
Constructor Details
-
Huffman
public Huffman(int[] frequencies)
-
-
Method Details
-
write
Write a value.- Parameters:
out- the output streamvalue- the value to write
-
read
Read a value.- Parameters:
in- the input stream- Returns:
- the value
-
getBitCount
public int getBitCount(int value) Get the number of bits of the Huffman code for this value.- Parameters:
value- the value- Returns:
- the number of bits
-