List of utility methods to do Array to Hex String
String | arrayToHexString(byte[] array) Helper method to convert a byte[] array (such as a MsgId) to a hex string return arrayToHexString(array, 0, array.length);
|
String | arraytohexstring(byte[] bytes) arraytohexstring StringBuilder string = new StringBuilder(); for (byte b : bytes) { String hexString = Integer.toHexString(0x00FF & b); string.append(hexString.length() == 1 ? "0" + hexString : hexString); return string.toString(); |
String | arrayToHexString(final byte[] byteArray) Convert a byte array into hex sequence like [#01 #02 #03] final StringBuilder result = new StringBuilder(); result.append('['); boolean space = false; for (final byte b : byteArray) { if (space) { result.append(' '); } else { space = true; ... |