public static String dumpHex(byte... hex) { String format = "$"; for (int i = 0; i < hex.length; i++) { format += "%02X "; } return String.format(format,hex); }
...Object[] tmp = new Object[hex.length];for(int i=0 ; i<hex.length ; i++) { tmp[i] = Integer.valueOf(hex[i] & 255);}return String.format(format, tmp);