String str= (char)255 + (char)255 +"1" ;
byte[] sendbuf = str.getBytes();
outputPacket = new DatagramPacket(sendbuf,sendbuf.length,
remoteIP,2280);
logSocket.send(outputPacket);
udp 收到的是 0x35 0x31 0x30 0x31 , 为什么?正确应该是 0xff 0xff 0x31
byte[] sendbuf = str.getBytes();
outputPacket = new DatagramPacket(sendbuf,sendbuf.length,
remoteIP,2280);
logSocket.send(outputPacket);
udp 收到的是 0x35 0x31 0x30 0x31 , 为什么?正确应该是 0xff 0xff 0x31
这多费劲,最好写自己和别人都容易看懂理解的。
0x35 0x31 0x30 0x31从结果上猜:255 + 255 = 510
String str= (char)255 + (char)255 +"1" ;
byte[] sendbuf = str.getBytes();
outputPacket = new DatagramPacket(sendbuf,sendbuf.length,
remoteIP,2280);
logSocket.send(outputPacket);
udp 收到的是 0x35 0x31 0x30 0x31 , 为什么?我想要收到 0xff 0xff 0x31 要怎样做??