public int getSerializedSize() {
        int size = 0;
        if (docId != null) {
            size += Utf8.byteCount(docId.toString()) + 1;
        }
        size += GlobalId.LENGTH;
        size += 8;
        size += 1;
        return size;
    }
@author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a>
documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/DocumentState.java