Code example for DataOutput

Methods: write, writeBoolean, writeInt, writeUTF

0
 
class ReadResponseMessageSerializer implements ICompactSerializer<ReadResponseMessage> 
{ 
	public void serialize(ReadResponseMessage rm, DataOutput dos) throws IOException
	{ 
		dos.writeUTF(rm.table());
        dos.writeInt(rm.digest().length);
        dos.write(rm.digest());
        dos.writeBoolean(rm.isDigestQuery());
 
        if( !rm.isDigestQuery() && rm.row() != null )
        { 
            Row.serializer().serialize(rm.row(), dos);
        } 
	} 
 
    public ReadResponseMessage deserialize(DataInputStream dis) throws IOException
    { 
    	String table = dis.readUTF();
        int digestSize = dis.readInt();
        byte[] digest = new byte[digestSize];