Click or drag to resize
RunLength Class
The RunLength class provides methods for compressing and expanding a binary input using run-length coding with 8-bit run lengths.
Inheritance Hierarchy
SystemObject
  Algs4NetRunLength

Namespace: Algs4Net
Assembly: Algs4Net (in Algs4Net.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public sealed class RunLength

The RunLength type exposes the following members.

Constructors
  NameDescription
Public methodRunLength
Uses file names to direct input and output
Top
Methods
  NameDescription
Public methodCompress
Reads a sequence of bits from standard input; compresses them using run-length coding with 8-bit run lengths; and writes the results to standard output.
Public methodExpand
Reads a sequence of bits from standard input (that are encoded using run-length encoding with 8-bit run lengths); decodes them; and writes the results to standard output.
Public methodStatic memberMainTest
Sample client that calls compress() if the command-line argument is "-" an expand() if it is "+".
Top
Remarks

For additional documentation, see Section 5.5 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.

This class is a C# port from the original Java class RunLength implementation by the respective authors.

See Also