(byte[] bytes)
| 123 | } |
| 124 | |
| 125 | public static String bytesToHex(byte[] bytes) { |
| 126 | char[] hexChars = new char[bytes.length * 2]; |
| 127 | for (int j = 0; j < bytes.length; j++) { |
| 128 | int v = bytes[j] & 0xFF; |
| 129 | hexChars[j * 2] = hexArray[v >>> 4]; |
| 130 | hexChars[j * 2 + 1] = hexArray[v & 0x0F]; |
| 131 | } |
| 132 | |
| 133 | return new String(hexChars).toUpperCase(); |
| 134 | } |
| 135 | |
| 136 | /** |
| 137 | * Transfers the length of the buffer amount of data from the input stream to |