/**
* 将byte转为16进制
*
* @param bytes
* @return
*/
private static String byte2Hex(byte[] bytes) {
  StringBuffer stringBuffer = new StringBuffer();
  String temp = null;
  for (int i = 0; i < bytes.length; i++) {
    temp = Integer.toHexString(bytes[i] & 0xFF);
    if (temp.length() == 1) {
      // 1得到一位的进行补0操作
      stringBuffer.append("0");
    }
    stringBuffer.append(temp);
  }
  return stringBuffer.toString();
}

相关文章:

  • 2022-02-13
  • 2022-12-23
  • 2022-12-23
  • 2021-12-01
  • 2021-08-16
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
猜你喜欢
  • 2021-07-10
  • 2021-12-10
  • 2022-02-21
  • 2021-06-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案