Package dsa
Class RunLength
- java.lang.Object
-
- dsa.RunLength
-
public class RunLength extends Object
This library provides static methods for compressing and expanding a binary input using run-length encoding with 8-bit run lengths.
-
-
Constructor Summary
Constructors Constructor Description RunLength()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
compress()
Reads from standard input a sequence of bits; compresses them using run-length coding with 8-bit run lengths; and writes the results to standard output.static void
expand()
Reads from standard input a sequence of runlength-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 bits; compresses them using run-length coding with 8-bit run lengths; and writes the results to standard output.
-
expand
public static void expand()
Reads from standard input a sequence of runlength-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.
-
-