public class BinaryDataUtil extends Object
Constructor and Description |
---|
BinaryDataUtil() |
Modifier and Type | Method and Description |
---|---|
static int |
compare(byte[] lhs,
byte[] rhs)
Compares two byte arrays.
|
static byte[] |
copy(byte[] data)
Creates a copy of the specified byte array.
|
static byte[] |
copy(byte[] data,
int offset,
int length)
Creates a copy of a subsequence of the specified byte array.
|
static byte[] |
parseHexBytes(String value)
Converts the given hexadecimal string value into a binary value.
|
static String |
toHexString(byte[] value)
Converts the given byte array into a string representing
the hex values of each byte.
|
public static byte[] copy(byte[] data)
data
- the byte array to copynull
if the input was null
, otherwise
a copy of the input arraypublic static byte[] copy(byte[] data, int offset, int length)
data
- the byte array to copyoffset
- the initial position of the subsequence in the arraylength
- the length of the subsequencenull
if the input was null
, otherwise
a copy of the subsequencepublic static String toHexString(byte[] value)
value
- binary value to convertnull
, the empty string ("")
is returned.public static byte[] parseHexBytes(String value)
value
- String value to convertbyte[]
encoded by the string.
null
is returned, if the encoding string is
null
.DRException
- if the input is not a valid hexadecimal stringpublic static int compare(byte[] lhs, byte[] rhs)
lhs
- Left hand side valuerhs
- Right hand side valueCopyright © 2016 Actian Corporation. All rights reserved.