public final class Hex extends Object
| Constructor and Description |
|---|
Hex() |
| Modifier and Type | Method and Description |
|---|---|
static Appendable |
append(Appendable a,
byte[] bytes)
Turns a
byte array into hex octets. |
static Appendable |
append(Appendable a,
int in)
Turns an
int into hex octets. |
static Appendable |
append(Appendable a,
int in,
int length)
Turns an
int into hex octets. |
static Appendable |
append(Appendable a,
long in)
Turns a
long into hex octets. |
static Appendable |
append(Appendable a,
long in,
int length)
Turns a
long into hex octets. |
static Appendable |
append(Appendable a,
short in)
Turns a
short into hex octets. |
static Appendable |
append(Appendable a,
short in,
int length)
Turns a
short into hex octets. |
static long |
parseLong(CharSequence s)
Parses a
long from a hex encoded number. |
static short |
parseShort(String s)
Parses a
short from a hex encoded number. |
public static Appendable append(Appendable a, short in)
short into hex octets.a - the Appendable, may not be nullin - the integerAppendablepublic static Appendable append(Appendable a, short in, int length)
short into hex octets.a - the Appendable, may not be nullin - the integerlength - the number of octets to produceAppendablepublic static Appendable append(Appendable a, int in)
int into hex octets.a - the Appendable, may not be nullin - the integerAppendablepublic static Appendable append(Appendable a, int in, int length)
int into hex octets.a - the Appendable, may not be nullin - the integerlength - the number of octets to produceAppendablepublic static Appendable append(Appendable a, long in)
long into hex octets.a - the Appendable, may not be nullin - the longAppendablepublic static Appendable append(Appendable a, long in, int length)
long into hex octets.a - the Appendable, may not be nullin - the longlength - the number of octets to produceAppendablepublic static Appendable append(Appendable a, byte[] bytes)
byte array into hex octets.a - the Appendable, may not be nullbytes - the byte arrayAppendablepublic static long parseLong(CharSequence s)
long from a hex encoded number. This method will skip all characters that are not 0-9,
A-F and a-f.
Returns 0 if the CharSequence does not contain any interesting characters.
s - the CharSequence to extract a long from, may not be nulllongNullPointerException - if the CharSequence is nullpublic static short parseShort(String s)
short from a hex encoded number. This method will skip all characters that are not 0-9,
A-F and a-f.
Returns 0 if the CharSequence does not contain any interesting characters.
s - the CharSequence to extract a short from, may not be nullshortNullPointerException - if the CharSequence is nullCopyright © 2003-2014. All Rights Reserved.