Class HuffmanTree
java.lang.Object
HuffmanTree
public class HuffmanTree
- extends Object
A Huffman Tree representation.
- Author:
- Michael Goldwasser
Constructor Summary |
HuffmanTree(BitReader in)
Creates a HuffmanTree structure based on encoded bit stream. |
HuffmanTree
public HuffmanTree(BitReader in)
throws IOException
- Creates a HuffmanTree structure based on encoded bit stream.
Note that bit stream does not encode original frequencies.
- Parameters:
in
- bit stream consistent with format of HuffmanTree.serialize
- Throws:
IOException
decode
public void decode(BitReader input,
OutputStream result)
throws IOException
- Takes encoded message and outputs decoded text
- Parameters:
input
- BitReader that contains encoded messageresult
- OutputStream to which decoded text is sent
- Throws:
IOException