Code example for DataInput

Methods: readFloat, readInt

0
		return Packet.OP_SETSTARTLOCATION; 
	} 
 
	@Override 
	protected void readPayload(DataInput input) throws IOException {
		this.x = input.readInt();
		this.y = input.readInt();
		this.heading = input.readFloat();
	} 
 
	@Override 
	protected void writePayload(DataOutput output) throws IOException {
		output.writeInt(this.x);
		output.writeInt(this.y);
		output.writeFloat(this.heading);
	} 
 
	public int getX() { 
		return x;
	}