首先看一下遇到的代码:
public static String parseByte2HexStr(byte buf[]) {
StringBuffer sbf = new StringBuffer();for (int i = 0; i < buf.length; i++) {
String hex = Integer.toHexString(buf[i] & 0xFF);
if (hex.length() == 1) {
hex = '0' + hex;
}
sb.append(hex.toUpperCase());
}
return sb.toString();
}