DatagramSocket socket = new DatagramSocket(inPort.getNumber(), InetAddress.getLocalHost());
// prepare outgoing packet
ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
DataOutputStream dataOut = new DataOutputStream(bytesOut);
dataOut.writeFloat(1.0f);
dataOut.writeFloat(2.0f);
byte[] bytesToSend = bytesOut.toByteArray();
DatagramPacket outboundPacket = new DatagramPacket(bytesToSend, bytesToSend.length,
InetAddress.getLocalHost(), outPort.getNumber());