日期:2014-05-20 浏览次数:20767 次
public static byte[] hexToBytes(String hexString) { if (hexString == null) return null; byte[] bytes = new byte[hexString.length()/2]; for (int i=0; i<bytes.length; i++) { bytes[i] = (byte)Integer.parseInt(hexString.substring(i*2, i*2+2), 16); } return bytes; }
------解决方案--------------------
你结贴率不高,不回答.......
------解决方案--------------------
hexStr.getbytes();