public final class HexString extends Object
| Modifier and Type | Method and Description |
|---|---|
byte[] |
asBytes()
N.B.
|
String |
asString() |
boolean |
equals(Object other) |
int |
hashCode() |
String |
toString() |
static HexString |
valueOf(byte[] bytes)
Create a new
HexString instance from the given byte array. |
static HexString |
valueOf(String hex)
Create a new
HexString instance from the given hexadecimal string. |
public static final HexString NULL
public static HexString valueOf(String hex)
HexString instance from the given hexadecimal string.
If null or an empty string is passed, will return a HexString instance
with empty hex value and zero-length byte array.hex - The hexadecimal stringHexString instance encapsulating the hexadecimal stringIllegalArgumentException - if malformed hex string (invalid or odd number of characters) is passedpublic static HexString valueOf(byte[] bytes)
HexString instance from the given byte array.
If null or zero-length byte array is passed, will return a HexString instance
with empty hex value and zero-length byte array.bytes - The byte arrayHexString instance encapsulating the byte arraypublic String asString()
public byte[] asBytes()
asBytes() returns a copy of the underlying byte arrayCopyright © 2012-2015 Cloudhopper by Twitter. All Rights Reserved.