Class ASHexString
java.lang.Object
com.adobe.internal.pdftoolkit.core.types.ASObject
com.adobe.internal.pdftoolkit.core.types.ASString
com.adobe.internal.pdftoolkit.core.types.ASHexString
- All Implemented Interfaces:
Comparable
This class represents a non-cos hex string.
-
Constructor Summary
ConstructorsConstructorDescriptionASHexString(byte[] bytes) Constructor.ASHexString(int[] numbers, int bytesToUse, int bytesToPad) Construct anASHexStringfrom an array of integers.ASHexString(int[] numbers, int startIndex, int endIndex, int bytesToUse, int bytesToPad) -
Method Summary
Modifier and TypeMethodDescriptionasString()Try to get a chars associated with a byte in this ASString.byte[]getHex()Returns hex value of string as byte array.toString()Attempts to get a unicode representation for this unencoded string.voidwrite(OutputByteStream outputStream) Writes the ASHexString in to the given OutputByteStream in the format expected by the PDF Spec.voidwrite(OutputStream outputStream) Writes the ASHexString in to the given OutputStream in the format expected by the PDF Spec.
-
Constructor Details
-
ASHexString
public ASHexString(byte[] bytes) Constructor. -
ASHexString
public ASHexString(int[] numbers, int bytesToUse, int bytesToPad) throws PDFInvalidParameterException Construct anASHexStringfrom an array of integers.- Parameters:
numbers- numbers to use in constructing the ASHexStringbytesToUse- 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
-
ASHexString
public ASHexString(int[] numbers, int startIndex, int endIndex, int bytesToUse, int bytesToPad) throws PDFInvalidParameterException - Throws:
PDFInvalidParameterException
-
-
Method Details
-
getHex
public byte[] getHex()Returns hex value of string as byte array. -
write
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:
-
write
Writes the ASHexString in to the given OutputByteStream in the format expected by the PDF Spec.- Overrides:
writein classASString- Parameters:
outputStream- OutputStream to write to.- Throws:
PDFIOException- See Also:
-
asString
Description copied from class:ASStringTry 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. -
toString
Description copied from class:ASStringAttempts to get a unicode representation for this unencoded string. No guarantees are made about what is returned.
-