| | |
| | | |
| | | /** |
| | | * Retrieves a string representation of the contents of the provided byte |
| | | * array using hexadecimal characters with no space between each byte. |
| | | * |
| | | * @param b The byte array containing the data. |
| | | * |
| | | * @return A string representation of the contents of the provided byte |
| | | * array using hexadecimal characters. |
| | | */ |
| | | public static String bytesToHexNoSpace(byte[] b) |
| | | { |
| | | if ((b == null) || (b.length == 0)) |
| | | { |
| | | return ""; |
| | | } |
| | | |
| | | int arrayLength = b.length; |
| | | StringBuilder buffer = new StringBuilder(arrayLength * 2); |
| | | |
| | | for (int i=0; i < arrayLength; i++) |
| | | { |
| | | buffer.append(byteToHex(b[i])); |
| | | } |
| | | |
| | | return buffer.toString(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves a string representation of the contents of the provided byte |
| | | * array using hexadecimal characters and a space between each byte. |
| | | * |
| | | * @param b The byte array containing the data. |