Class ASCIIHexDecode


  • public class ASCIIHexDecode
    extends java.lang.Object
    decode an array of hex nybbles into a byte array
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.nio.ByteBuffer buf  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ASCIIHexDecode​(java.nio.ByteBuffer buf)
      initialize the decoder with an array of bytes in ASCIIHex format
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private java.nio.ByteBuffer decode()
      decode the array
      static java.nio.ByteBuffer decode​(java.nio.ByteBuffer buf, PDFObject params)
      decode an array of bytes in ASCIIHex format.
      private int readHexDigit()
      get the next character from the input
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • buf

        private java.nio.ByteBuffer buf
    • Constructor Detail

      • ASCIIHexDecode

        private ASCIIHexDecode​(java.nio.ByteBuffer buf)
        initialize the decoder with an array of bytes in ASCIIHex format
    • Method Detail

      • 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

        public static java.nio.ByteBuffer decode​(java.nio.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