Code example for DataOutputStream

Methods: flush, writeBoolean, writeFloat, writeInt

0
     * @throws Exception 
     */ 
    public void send(int header, float[] data, boolean bit) throws Exception {
        System.out.println(" Comm send " + header + " " + data[0] + " " + data[1] + " " + data[2]);
        try { 
            dataOut.writeInt(header);
            dataOut.writeFloat(data[0]);
            dataOut.writeFloat(data[1]);
            dataOut.writeFloat(data[2]);
            dataOut.writeBoolean(bit);
            dataOut.flush();
        } catch (Exception e) {
            e.printStackTrace();
        } 
        reader.reading = true;
    } 
 
    public NXTConnector getConnector() { 
        return connector;
    }