Package com.sun.pdfview.decode
Class ASCII85Decode
java.lang.Object
com.sun.pdfview.decode.ASCII85Decode
decode ASCII85 text into a byte array.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ASCII85Decode
(ByteBuffer buf) initialize the decoder with byte buffer in ASCII85 format -
Method Summary
Modifier and TypeMethodDescriptionprivate ByteBuffer
decode()
decode the bytesstatic ByteBuffer
decode
(ByteBuffer buf, PDFObject params) decode an array of bytes in ASCII85 format.private boolean
decode5
(ByteArrayOutputStream baos) decode the next five ASCII85 characters into up to four decoded bytes.private int
nextChar()
get the next character from the input.
-
Field Details
-
buf
-
-
Constructor Details
-
ASCII85Decode
initialize the decoder with byte buffer in ASCII85 format
-
-
Method Details
-
nextChar
private int nextChar()get the next character from the input.- Returns:
- the next character, or -1 if at end of stream
-
decode5
decode the next five ASCII85 characters into up to four decoded bytes. Return false when finished, or true otherwise.- Parameters:
baos
- the ByteArrayOutputStream to write output to, set to the correct position- Returns:
- false when finished, or true otherwise.
- Throws:
PDFParseException
-
decode
decode the bytes- Returns:
- the decoded bytes
- Throws:
PDFParseException
-
decode
decode an array of bytes in ASCII85 format.In ASCII85 format, every 5 characters represents 4 decoded bytes in base 85. The entire stream can contain whitespace, and ends in the characters '~>'.
- Parameters:
buf
- the encoded ASCII85 characters in a byte bufferparams
- parameters to the decoder (ignored)- Returns:
- the decoded bytes
- Throws:
PDFParseException
-