Class ASHexString

  • All Implemented Interfaces:

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

      Constructor Description
      ASHexString​(byte[] bytes)
      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)
      • ASHexString

        public ASHexString​(int[] numbers,
                           int bytesToUse,
                           int bytesToPad)
                    throws PDFInvalidParameterException
        Construct an ASHexString from an array of integers.
        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
        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​( outputStream)
                   throws PDFIOException
        Writes the ASHexString in to the given OutputStream in the format expected by the PDF Spec.
        outputStream - OutputStream to write to.
        See Also:
      • 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.
        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.
        toString in class ASString