发送方里有两个负数(全是正数的话就没有错误),发过去后,字节长度增加了4个字节,使用outputstream和inputstream来收发,具体如下:
发送字节数组:
byte[] commandBytes1={。。。。 ,(byte)0xC0 ,(byte)0xA8 。。。}; //
共有60个字节
(byte)0xC0 ,(byte)0xA8是转换成两个负数字节
接收到的字节数组(6个负数对应(byte)0xC0 ,(byte)0xA8两个字节)
-17
-65
-67
-17
-65
-67
1
2
7
24
0
0
0
0
0
0
发送字节数组:
byte[] commandBytes1={。。。。 ,(byte)0xC0 ,(byte)0xA8 。。。}; //
共有60个字节
(byte)0xC0 ,(byte)0xA8是转换成两个负数字节
接收到的字节数组(6个负数对应(byte)0xC0 ,(byte)0xA8两个字节)
-17
-65
-67
-17
-65
-67
1
2
7
24
0
0
0
0
0
0