Package com.sun.pdfview.decode
Class RunLengthDecode
- java.lang.Object
-
- com.sun.pdfview.decode.RunLengthDecode
-
public class RunLengthDecode extends java.lang.Objectdecode an array of Run Length encoded bytes into a byte array
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.ByteBufferbufprivate static intRUN_LENGTH_EODthe end of data in the RunLength encoding.
-
Constructor Summary
Constructors Modifier Constructor Description privateRunLengthDecode(java.nio.ByteBuffer buf)initialize the decoder with an array of bytes in RunLength format
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.nio.ByteBufferdecode()decode the arraystatic java.nio.ByteBufferdecode(java.nio.ByteBuffer buf, PDFObject params)decode an array of bytes in RunLength format.
-
-
-
Field Detail
-
RUN_LENGTH_EOD
private static final int RUN_LENGTH_EOD
the end of data in the RunLength encoding.- See Also:
- Constant Field Values
-
buf
private java.nio.ByteBuffer buf
-
-
Method Detail
-
decode
private java.nio.ByteBuffer decode() throws PDFParseExceptiondecode the array- Returns:
- the decoded bytes
- Throws:
PDFParseException
-
decode
public static java.nio.ByteBuffer decode(java.nio.ByteBuffer buf, PDFObject params) throws PDFParseExceptiondecode an array of bytes in RunLength format.RunLength format consists of a sequence of a byte-oriented format based on run length. There are a series of "runs", where a run is a length byte followed by 1 to 128 bytes of data. If the length is 0-127, the following length+1 (1 to 128) bytes are to be copied. If the length is 129 through 255, the following single byte is copied 257-length (2 to 128) times. A length value of 128 means and End of Data (EOD).
- Parameters:
buf- the RUnLEngth encoded bytes in a byte bufferparams- parameters to the decoder (ignored)- Returns:
- the decoded bytes
- Throws:
PDFParseException
-
-