public void write(final DataOutput out) throws IOException { out.writeByte(PUT_VERSION); Bytes.writeByteArray(out, this.row); out.writeLong(this.timestamp); out.writeLong(this.lockId); out.writeBoolean(this.writeToWAL); out.writeInt(familyMap.size()); for (Map.Entry> entry : familyMap.entrySet()) { Bytes.writeByteArray(out, entry.getKey()); List keys = entry.getValue(); out.writeInt(keys.size()); int totalLen = 0; for(KeyValue kv : keys) { totalLen += kv.getLength(); } out.writeInt(totalLen); for(KeyValue kv : keys) { out.writeInt(kv.getLength()); out.write(kv.getBuffer(), kv.getOffset(), kv.getLength()); } } }