public final class ByteOps extends Object
| Modifier and Type | Method and Description |
|---|---|
static int |
copy(byte[] src,
int srcOff,
byte[] dst,
int dstOff,
int len)
Copies source to destion array.
|
static int |
endsWithPartial(byte[] src,
int srcOff,
byte[] suffix,
int sufOff)
Returns the index at which this suffix exists in the src array.
|
static int |
equalArrays(byte[] src,
int srcOff,
byte[] dst,
int dstOff,
int len)
Checks the equality of two byte arrays.
|
static byte |
getHex(byte b)
Converts the specified hexidecimal character to a byte value.
|
static byte[] |
getHex(byte[] src)
Returns hex representation of src.
|
static byte[] |
getHex(byte[] src,
int size)
Hex encodes the data in src to a new byte array that is
of length size.
|
static ASName |
getHexName(byte[] in)
Converts the contents of a byte[] to a hex name (lowercase).
|
static ASName |
getHexName(byte[] in,
boolean uppercase)
Converts the contents of a byte[] to a hex name.
|
static String |
getHexString(byte[] in)
Converts the contents of a byte[] to a hex string.
|
static String |
getHexString(byte[] in,
int size)
Converts the contents of a byte[] to a hex string.
|
static String |
getHexString2(byte[] in)
Converts the contents of a byte[] to a hex string.
|
static byte |
getNumericalValue(byte b)
Returns the numerical value for a byte that is used to represent a character.
|
static String |
getUnicode(byte[] unicodeBytes)
In presumption that the input byte array contains Unicode characters
converts them to Java String.
|
static boolean |
isASCII(byte[] bytes) |
static boolean |
isDigit(byte b)
Determines whether the specified byte represents a decimal digit.
|
static boolean |
isHexDigit(byte b)
Determines whether the specified byte represents a hex digit.
|
static boolean |
isLeadingOctalDigit(byte b)
Determines whether the specified byte represents a leading octal digit.
|
static boolean |
isLiteral(byte b)
Determines whether the specified byte represents a literal PDF
character.
|
static boolean |
isOctalDigit(byte b)
Determines whether the specified byte represents an octal digit.
|
static boolean |
isRegular(byte b)
Determines whether the specified byte represents a regular PDF
character.
|
static boolean |
isWhitespace(byte b)
Determines whether the specified byte represents a PDF whitespace
character.
|
static boolean |
isWhitespace(char c)
Determines whether the specified character represents a PDF whitespace
character.
|
static int |
readField(byte[] s,
int pos)
Reads two characters that are assumed to be digits and combines them
into a decimal value.
|
static byte[] |
splitInt2Bytes(int src,
int count)
Converts the integer passed here to byte array.
|
static byte[] |
toByte(short word0) |
static byte[] |
xorArray(byte[] array,
byte with)
Computes the XOR of the individual bytes of arrays passed here and returns it.
|
public static final boolean isWhitespace(byte b)
b - Character to testpublic static final boolean isWhitespace(char c)
c - Character to testpublic static boolean isASCII(byte[] bytes)
public static final byte[] xorArray(byte[] array,
byte with)
public static int endsWithPartial(byte[] src,
int srcOff,
byte[] suffix,
int sufOff)
public static final int equalArrays(byte[] src,
int srcOff,
byte[] dst,
int dstOff,
int len)
public static final int copy(byte[] src,
int srcOff,
byte[] dst,
int dstOff,
int len)
public static final byte[] splitInt2Bytes(int src,
int count)
public static final boolean isRegular(byte b)
b - Character to testpublic static final boolean isLiteral(byte b)
b - Character to testpublic static final boolean isDigit(byte b)
b - Character to testpublic static final boolean isHexDigit(byte b)
b - Character to testpublic static final boolean isOctalDigit(byte b)
b - Character to testpublic static final boolean isLeadingOctalDigit(byte b)
b - Character to testpublic static final byte getNumericalValue(byte b)
b - Character to testpublic static int readField(byte[] s,
int pos)
throws PDFParseException
s - Byte array containing two characters to convert to a
a numeric valuepos - Position in the array where the characters startPDFParseException - If two characters could not be read from the
byte array or the characters did not correspond
to decimal digits.public static byte[] getHex(byte[] src)
public static byte[] getHex(byte[] src,
int size)
public static String getHexString(byte[] in)
public static ASName getHexName(byte[] in) throws UnsupportedEncodingException
in - UnsupportedEncodingExceptionpublic static ASName getHexName(byte[] in, boolean uppercase)
in - the bytes used to make the hex nameuppercase - true if the hex should utilize upper-case alpha characters;
false if the alpha characters should be lower-casepublic static String getHexString(byte[] in, int size) throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic static String getHexString2(byte[] in)
public static byte getHex(byte b)
throws PDFParseException
b - Hex character to convertPDFParseExceptionpublic static String getUnicode(byte[] unicodeBytes)
unicodeBytes - public static final byte[] toByte(short word0)
Copyright © 2010 - 2020 Adobe. All Rights Reserved