Class ASCIIHexDecode

java.lang.Object
com.sun.pdfview.decode.ASCIIHexDecode

public class ASCIIHexDecode extends Object
decode an array of hex nybbles into a byte array
  • Field Details

  • Constructor Details

    • ASCIIHexDecode

      private ASCIIHexDecode(ByteBuffer buf)
      initialize the decoder with an array of bytes in ASCIIHex format
  • Method Details

    • readHexDigit

      private int readHexDigit() throws PDFParseException
      get the next character from the input
      Returns:
      a number from 0-15, or -1 for the end character
      Throws:
      PDFParseException
    • decode

      private ByteBuffer decode() throws PDFParseException
      decode the array
      Returns:
      the decoded bytes
      Throws:
      PDFParseException
    • decode

      public static ByteBuffer decode(ByteBuffer buf, PDFObject params) throws PDFParseException
      decode an array of bytes in ASCIIHex format.

      ASCIIHex format consists of a sequence of Hexidecimal digits, with possible whitespace, ending with the '>' character.

      Parameters:
      buf - the encoded ASCII85 characters in a byte buffer
      params - parameters to the decoder (ignored)
      Returns:
      the decoded bytes
      Throws:
      PDFParseException