java byte[] 的骚操作
类似于C数组的操作
byte[] bytetest = {0x01,0x03};
实现C语言的常量结构体数组
class AnsData {
public byte[] req_buf;
public byte[] ans_buf;
public AnsData(byte[] str_in, byte[] str2){
req_buf = str_in;
ans_buf = str2;
}
};
AnsData[] AnsDataLib = {
new AnsData(new byte[]{0x01, 0x03}, new byte[]{0x43,0x00}),
new AnsData(new byte[]{0x01,0x07}, new byte[]{0x47,0x00}),
};
浙公网安备 33010602011771号