java吧 关注:1,238,046贴子:12,710,352
  • 2回复贴,共1

大小端传输问题

只看楼主收藏回复

public static void main(String[] args) throws IOException, InterruptedException {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
DataOutput output = new DataOutputStream(outputStream);
DatagramSocket ds = new DatagramSocket(8888);
output.writeDouble(1.0);
output.writeDouble(2.0);
output.writeDouble(3.0);
output.writeDouble(4.0);
byte[] buf = outputStream.toByteArray();
DatagramPacket dp =
new DatagramPacket(buf,buf.length,InetAddress.getByName("255.255.255.255"),56789);
ds.send(dp);
ds.close();
}
怎样将buf以小端发送数据啊,求指导····


IP属地:北京1楼2013-12-11 21:00回复
    什么是小端。。


    2楼2013-12-11 21:10
    收起回复