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
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 anASHexStringfrom an array of integers.ASHexString(int[] numbers, int startIndex, int endIndex, int bytesToUse, int bytesToPad)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringasString()Try to get a chars associated with a byte in this ASString.byte[]getHex()Returns hex value of string as byte array.StringtoString()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 Detail
-
ASHexString
public ASHexString(byte[] bytes)
Constructor.
-
ASHexString
public ASHexString(int[] numbers, int bytesToUse, int bytesToPad) throws PDFInvalidParameterExceptionConstruct 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 Detail
-
getHex
public byte[] getHex()
Returns hex value of string as byte array.
-
write
public void write(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
-
write
public void write(OutputByteStream outputStream) throws PDFIOException
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
-
asString
public String 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.
-
-