我的代码是:
String str= (char)255 + (char)255 +"1" ;
byte[] sendbuf = str.getBytes();
outputPacket = new DatagramPacket(sendbuf,sendbuf.length,remoteIP,2280);
logSocket.send(outputPacket);
我得到的结果是“0x35 0x31 0x30 0x31”
但我想要的是:0xff 0xff 0x31
这个怎么做?
我的代码是:
String str= (char)255 + (char)255 +"1" ;
byte[] sendbuf = str.getBytes();
outputPacket = new DatagramPacket(sendbuf,sendbuf.length,remoteIP,2280);
logSocket.send(outputPacket);
我得到的结果是“0x35 0x31 0x30 0x31”
但我想要的是:0xff 0xff 0x31
这个怎么做?