Code example for DataOutputStream

Methods: write, writeFloat

0
        onGround = in.readByte()!=0;
    } 
 
    @Override 
    public void encode( DataOutputStream out ) throws IOException {
        out.writeFloat( yaw );
        out.writeFloat( pitch );
        out.write( onGround ? 1 : 0);
    } 
 
    public float getYaw() { 
        return yaw;
    } 
 
    public float getPitch() { 
        return pitch;
    } 
 
    public boolean isOnGround() { 
        return onGround;
    }