Code example for DataOutput

Methods: write, writeInt, writeShort, writeUTF

0
		in.readFully(key);
	} 
	 
	@Override 
	public void writeToDataOutput(DataOutput out) throws IOException {
		out.writeUTF(name);
		out.writeUTF(host);
		out.writeInt(port);
		out.writeInt(gameId);
		out.writeInt(keyTime);
		out.writeShort(key.length);
		out.write(key);
	} 
	 
	@Override 
	public String toString() {
		return "RECONNECT " + name + " " + host + ":" + port + " " + gameId + " " + keyTime + " " + Arrays.toString(key);
	} 
}