16进制转10进制和2进制
/** * 16进制转10进制 * * @param str * @return */ public static String sixteenToTen(String str) { int ten = Integer.parseInt(str, 16); String result = String.valueOf(ten); return result; } /** * 16进制转2进制 * @param str * @return */ public static String hexStringTobinaryString(String hexString){ if(null==hexString||hexString.length()%2!=0){ return null; } String bString=""; String temp=""; for (int i = 0; i < hexString.length(); i++) { temp = "0000" + Integer.toBinaryString(Integer.parseInt(hexString .substring(i, i + 1), 16)); bString += temp.substring(temp.length() - 4); } return bString; }