Class ASHexString

  • All Implemented Interfaces:
    java.lang.Comparable

    public class ASHexString
    extends ASString
    This class represents a non-cos hex string.
    • Constructor Summary

      Constructors 
      Constructor Description
      ASHexString​(byte[] bytes)
      Constructor.
      ASHexString​(int[] numbers, int bytesToUse, int bytesToPad)
      Construct an ASHexString from an array of integers.
      ASHexString​(int[] numbers, int startIndex, int endIndex, int bytesToUse, int bytesToPad)  
    • Constructor Detail

      • ASHexString

        public ASHexString​(byte[] bytes)
        Constructor.
      • ASHexString

        public ASHexString​(int[] numbers,
                           int bytesToUse,
                           int bytesToPad)
                    throws PDFInvalidParameterException
        Construct an ASHexString from an array of integers.
        Parameters:
        numbers - numbers to use in constructing the ASHexString
        bytesToUse - number of bytes to use from each number starting with the LSB. Must be from 1 to 4.
        bytesToPad - number of bytes to pad in front of each number beyond the number of bytes taken from each number
        Throws:
        PDFInvalidParameterException - if the bytesToUse is not between 1 and 4
    • Method Detail

      • getHex

        public byte[] getHex()
        Returns hex value of string as byte array.
      • write

        public void write​(java.io.OutputStream outputStream)
                   throws PDFIOException
        Writes the ASHexString in to the given OutputStream in the format expected by the PDF Spec.
        Parameters:
        outputStream - OutputStream to write to.
        Throws:
        PDFIOException
        See Also:
        ASString
      • asString

        public java.lang.String asString()
        Description copied from class: ASString
        Try to get a chars associated with a byte in this ASString. Note that, because ASString has no encoding, this just uses a series of heuristics to get the chars. No guarantees are made regarding the returned value other than "we tried our best". It may change over time.
        Overrides:
        asString in class ASString
      • toString

        public java.lang.String toString()
        Description copied from class: ASString
        Attempts to get a unicode representation for this unencoded string. No guarantees are made about what is returned.
        Overrides:
        toString in class ASString