|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dellroad.stuff.string.ByteArrayEncoder
public final class ByteArrayEncoder
Encodes byte[] arrays to and from hexadecimal strings.
| Method Summary | |
|---|---|
static byte[] |
decode(String text)
Decode a String back into a byte[] array. |
static String |
encode(byte[] array)
Encode a byte[] array as a String. |
static String |
encode(byte[] array,
int off,
int len)
Encode a byte[] array as a String. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static String encode(byte[] array)
byte[] array as a String.
Equivalent to:
encode(array, 0, array.length)
array - byte array, or null
null if array was null)
public static String encode(byte[] array,
int off,
int len)
byte[] array as a String.
array - byte array, or nulloff - offset into the arraylen - number of bytes to convert
null if array was null)
IndexOutOfBoundsException - if array bounds are exceeded
IllegalArgumentException - if len is greater than Integer.MAX_VALUE / 2public static byte[] decode(String text)
String back into a byte[] array.
Any extra whitespace in the string is ignored.
text - string previously encoded by encode(byte[]), or null
byte[] array (or null if text was null)
IllegalArgumentException - if any invalid non-whitespace characters are seen, or the number of hex digits is odd
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||