public static String toHexString2(byte[] b) { StringBuffer buffer = new StringBuffer(); for (int i = 0; i < b.length; ++i) { buffer.append(toHexString2(b[i])); } return buffer.toString(); } public static String toHexString2(byte b) { char[] buffer = new char[2]; buffer[0] = Character.forDigit((b >>> 4) & 0x0F, 16); buffer[1] = Character.forDigit(b & 0x0F, 16); return new String(buffer); }
java 16进制转换10进制,布布扣,bubuko.com
时间: 2024-10-12 13:43:06