Class HuffmanTree

java.lang.Object
  extended by 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.
 
Method Summary
 void decode(BitReader input, OutputStream result)
          Takes encoded message and outputs decoded text
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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
Method Detail

decode

public void decode(BitReader input,
                   OutputStream result)
            throws IOException
Takes encoded message and outputs decoded text

Parameters:
input - BitReader that contains encoded message
result - OutputStream to which decoded text is sent
Throws:
IOException