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
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));
103 阅读 ← 返回技术栈
图片放大