public class Huffman extends java.lang.Object
For additional documentation, see Section 5.5 of "Algorithms, 4th Edition," by Robert Sedgewick and Kevin Wayne.
Constructor and Description |
---|
Huffman() |
Modifier and Type | Method and Description |
---|---|
static void |
compress()
Compresses the bytestream from standard input
and writes the compressed bitstream to standard output.
|
static void |
expand()
Expands the encoded bitstream from standard input
and writes the decoded bytestream to standard output.
|
static void |
main(java.lang.String[] args)
Test client.
|
public static void compress()
public static void expand()
public static void main(java.lang.String[] args)
% java Huffman - < abra.txt | java BinaryDump 60 010100000100101000100010010000110100001101010100101010000100 000000000000000000000000000110001111100101101000111110010100 120 bits % java Huffman - < abra.txt | java Huffman + ABRACADABRA!