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以小端发送数据啊,求指导····
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以小端发送数据啊,求指导····