public void serialize(Serializer buf) {
        if (docId != null) {
            buf.putByte(null, (byte) 1);
            docId.serialize(buf);
        } else {
            buf.putByte(null, (byte) 0);
        }
        gid.serialize(buf);
        buf.putLong(null, timestamp);
        buf.putByte(null, (byte)(removeEntry ? 1 : 0));
    }
@author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a>
documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/DocumentState.java