public static byte[] hexStr2Byte(String hex) { ByteBuffer bf = ByteBuffer.allocate(hex.length() / 2); for (int i = 0; i < hex.length(); i++) { String hexStr = hex.charAt(i) + ""; i++; hexStr += hex.charAt(i); byte b = (byte) Integer.parseInt(hexStr, 16); bf.put(b); } return bf.array(); }
版权声明:本文为qq_16165281原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。