- /**16进制字符集**/
- private static final char HEX_DIGITS[] = { '0', '1', '2', '3', '4', '5','6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
- public static String byteToHex(byte bt) {
- return HEX_DIGITS[(bt & 0xf0) >> 4] + "" + HEX_DIGITS[bt & 0xf];
- }
复制代码 谁帮忙解释下原理啊
bt & 0xf0?
(bt & 0xf0) >> 4?
HEX_DIGITS[bt & 0xf]?
|