java 如何对于c语言memcpy函数的数据解析(硬件对接)
String hexStr = "3439393930";
byte[] bytes = new byte[5];
for (int i = 0;i < 5; i++) {
bytes[i] = (byte) Integer.valueOf(hexStr.substring(i*2,(i+1)*2),16).intValue();
}
System.out.printf("获取的值:"+new String(bytes));
String hexStr = "3439393930";
byte[] bytes = new byte[5];
for (int i = 0;i < 5; i++) {
bytes[i] = (byte) Integer.valueOf(hexStr.substring(i*2,(i+1)*2),16).intValue();
}
System.out.printf("获取的值:"+new String(bytes));