Class RunLengthOutputStream

java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.jpedal.io.filter.RunLengthOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public class RunLengthOutputStream extends FilterOutputStream
An output stream that encodes output bytes using Run Length Encoding

The encoded data shall be a sequence of runs, where each run shall consist of a length byte followed by 1 to 128 bytes of data. If the length byte is in the range 0 to 127, the following length + 1 (1 to 128) bytes shall be copied literally during decompression. If length is in the range 129 to 255, the following single byte shall be copied 257 - length (2 to 128) times during decompression. A length value of 128 shall denote EOD.