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
解决方案 »
- fragment中的onCreateView和onViewCreated的区别和联系
- webview 加载本地html5页面使用本地缓存数据库出错
- android 全景照相
- 怎么知道手机是否正在下载软件?
- gps定位问题
- 标题栏能否随心显示
- 如何在代码里设置layout_gravity?
- sqlite中修改 id INTEGER PRIMARY KEY(菜鸟问题)
- 新手求助,ecplise怎么进入android试图啊
- android获取本机号码的方法
- 在windows下编译webkit出错WebKitSupportLibrary.zip is out of date.
- android sdk manager更新的问题
这多费劲,最好写自己和别人都容易看懂理解的。
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 要怎样做??