Package dsa
Class Huffman
- java.lang.Object
-
- dsa.Huffman
-
public class Huffman extends Object
This data type provides static methods for compressing and expanding a binary input using Huffman codes over the 8-bit extended ASCII alphabet.
-
-
Constructor Summary
Constructors Constructor Description Huffman()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
compress()
Reads from standard input a sequence of bytes; compresses them using Huffman codes with an 8-bit alphabet; and writes the results to standard output.static void
expand()
Reads from standard input a sequence of Huffman-compressed bits; expands them; and writes the results to standard output.static void
main(String[] args)
Unit tests the library.
-
-
-
Method Detail
-
compress
public static void compress()
Reads from standard input a sequence of bytes; compresses them using Huffman codes with an 8-bit alphabet; and writes the results to standard output.
-
expand
public static void expand()
Reads from standard input a sequence of Huffman-compressed bits; expands them; and writes the results to standard output.
-
main
public static void main(String[] args)
Unit tests the library.- Parameters:
args
- the command-line arguments.
-
-