字节数组转16进制 @param bytes @return
(byte[] bytes)
| 68 | * @return |
| 69 | */ |
| 70 | public static String bytesToHex(byte[] bytes) { //字节转16进制 |
| 71 | StringBuffer stringBuffer = new StringBuffer(); |
| 72 | for (int i = 0; i < bytes.length; i++) { |
| 73 | String s = Integer.toHexString(bytes[i] & 0xFF); |
| 74 | if (s.length() < 2) { |
| 75 | s = "0" + s; |
| 76 | } |
| 77 | stringBuffer.append(s.toLowerCase()); |
| 78 | } |
| 79 | return stringBuffer.toString(); |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * unicode 转字符串 |
nothing calls this directly
no outgoing calls
no test coverage detected