Hello, dear.
At the moment I use a subject of this type:
public static String toHexString(byte[] ba) { StringBuilder str = new StringBuilder(); for (int i = 0; i < ba.length; i++) { str.append(ba[i]<16?"0":"") .append(String.format("%x",ba[i]).toUpperCase()); } return str.toString().trim(); }
I can not figure out why the result may be:
00 00 0D 00 00 00 00 00 54 00 65 00 73 00 74 00 20 00 4D 00 65 00 73 00 73 00 61 00 67 00 65 00 00 00 0D2 04 00 00
After all, D2 == 210 and clearly more than 16 ...
Tell me, please, what could be the reason, and I would also like to see the most correct, from your point of view, implementation of the subject. Thank!