class Hex {
/**
* Hexadecimal representation of <code>data</code> with spaces between
* individual bytes.
*
* @param data the byte array to print.
*
* @return spaced hexadecimal representation of <code>data</code>.
*/
public static String bytesToSpacedHexString(byte[] data) {
String result = "";
for (int i = 0; i < data.length; i++) {
result += byteToHexString(data[i]);
result += (i < data.length - 1) ? " " : "";
}
result = result.toUpperCase();
return result;
}
}