Code example for DataOutput

Methods: writewriteIntwriteShortwriteUTF

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);
	} 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE