| Modifier and Type | Field and Description |
|---|---|
| private static final byte[] | HEX_BYTES
for hex conversion. |
| private static final char[] | |
| private static final Log |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static byte[] | Returns: the decoded String as a byte array.a base64 encoded String. base64Value)Decode a base64 String. |
| public static byte[] | |
| public static byte[] | Returns: the ASCII hex encoding of the given bytethe byte to be converted b)Returns the bytes corresponding to the ASCII hex encoding of the given byte. |
| public static byte[] | Returns: the ASCII hex encoding of the given bytesthe bytey to be converted bytes)Returns the bytes corresponding to the ASCII hex encoding of the given bytes. |
| public static char[] | Returns: the ASCII hex encoding of the given short valuethe short value to be converted num)Returns the characters corresponding to the ASCII hex encoding of the given short. |
| public static char[] | Returns: The string converted to hexThe string to convert text)Takes the characters in the given string, convert it to bytes in UTF16-BE format and build a char array that corresponds to the ASCII hex encoding of the resulting bytes. |
| private static int | |
| private static int | |
| public static String | Returns: the hex string representing the given bytethe byte to be converted b)Returns a hex string of the given byte. |
| public static String | Returns: the hex string representing the given bytesthe bytes to be converted bytes)Returns a hex string of the given byte array. |
| public static void | writeHexByte(byte
the byte to be written b, OutputStream the output stream to be written to output)Writes the given byte as hex value to the given output stream. |
| public static void | writeHexBytes(byte[]
the byte array to be written bytes, OutputStream the output stream to be written to output)Writes the given byte array as hex value to the given output stream. |
| HEX_BYTES | back to summary |
|---|---|
| private static final byte[] HEX_BYTES for hex conversion. https://stackoverflow.com/questions/2817752/java-code-to-convert-byte-to-hexadecimal | |
| HEX_CHARS | back to summary |
|---|---|
| private static final char[] HEX_CHARS | |
| LOG | back to summary |
|---|---|
| private static final Log LOG | |
| Hex | back to summary |
|---|---|
| private Hex() | |
| decodeBase64 | back to summary |
|---|---|
| public static byte[] decodeBase64(String base64Value) Decode a base64 String.
| |
| decodeHex | back to summary |
|---|---|
| public static byte[] decodeHex(String s) Decodes a hex String into a byte array.
| |
| getBytes | back to summary |
|---|---|
| public static byte[] getBytes(byte b) Returns the bytes corresponding to the ASCII hex encoding of the given byte.
| |
| getBytes | back to summary |
|---|---|
| public static byte[] getBytes(byte[] bytes) Returns the bytes corresponding to the ASCII hex encoding of the given bytes.
| |
| getChars | back to summary |
|---|---|
| public static char[] getChars(short num) Returns the characters corresponding to the ASCII hex encoding of the given short.
| |
| getCharsUTF16BE | back to summary |
|---|---|
| public static char[] getCharsUTF16BE(String text) Takes the characters in the given string, convert it to bytes in UTF16-BE format and build a char array that corresponds to the ASCII hex encoding of the resulting bytes. Example:
getCharsUTF16BE("ab") == new char[]{'0','0','6','1','0','0','6','2'}
| |
| getHighNibble | back to summary |
|---|---|
| private static int getHighNibble(byte b) Get the high nibble of the given byte.
| |
| getLowNibble | back to summary |
|---|---|
| private static int getLowNibble(byte b) Get the low nibble of the given byte.
| |
| getString | back to summary |
|---|---|
| public static String getString(byte b) Returns a hex string of the given byte.
| |
| getString | back to summary |
|---|---|
| public static String getString(byte[] bytes) Returns a hex string of the given byte array.
| |
| writeHexByte | back to summary |
|---|---|
| public static void writeHexByte(byte b, OutputStream output) throws IOException Writes the given byte as hex value to the given output stream.
| |
| writeHexBytes | back to summary |
|---|---|
| public static void writeHexBytes(byte[] bytes, OutputStream output) throws IOException Writes the given byte array as hex value to the given output stream.
| |