public String printHexString(byte[] b) {
String res = "";
for (int i = 0; i < b.length; i++) {
String hex = Integer.toHexString(b[i] & 0xFF);
if (hex.length() == 1) {
hex = '0' + hex;
}
res += hex;
}
return res;
}
java16进制转字符串方法
最新推荐文章于 2024-05-21 22:13:42 发布