public class HexHelper
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
decode(java.lang.String s)
decode a hexidecimal string into an array of bytes
|
static java.lang.String |
encode(byte[] b)
encode an array of bytes into a hexidecimal String
|
public static final java.lang.String encode(byte[] b)
The string is supplied without any prefix
b - byte[], the array to encodejava.lang.NullPointerException - if no bytes were suppliedpublic static final byte[] decode(java.lang.String s)
If it is prefixed with '0x' this will be removed first.
If the String has an odd length '0' will be prepended
s - String, the hexidecimal String to decodejava.lang.NullPointerException - if String is null