Code example for DataInput

Methods: readBoolean, readFully, readInt, readShort, readUTF

0
	public boolean isFromArena;
	public byte[] key = new byte[0];
 
	@Override 
	public void parseFromInput(DataInput in) throws IOException {
		this.name = in.readUTF();
		this.host = in.readUTF();
		this.port = in.readInt();
		this.gameId = in.readInt();
		this.keyTime = in.readInt();
		this.isFromArena = in.readBoolean();
		this.key = new byte[in.readShort()];
		in.readFully(key);
	} 
 
	@Override 
	public void writeToOutput(DataOutput out) throws IOException {
		out.writeUTF(this.name);
		out.writeUTF(this.host);
		out.writeInt(this.port);
		out.writeInt(this.gameId);