/**
* 数组转成十六进制字符串
* @param byte[]
* @return HexString
*/
public static String toHexString1(byte[] b){
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < b.length; ++i){
buffer.append(toHexString1(b[i]));
}
return buffer.toString();
}
public static String toHexString1(byte b){
String s = Integer.toHexString(b & 0xFF);
if (s.length() == 1){
return "0" + s;
}else{
return s;
}
}
byte数组转成十六进制字符串
最新推荐文章于 2024-06-28 01:36:16 发布