@Override
    public <T> void writeObject(final int fieldNumber, final T value, final Schema<T> schema,
            final boolean repeated) throws IOException
    {
        if (encodeNestedMessageAsGroup)
        {
            writeObjectEncodedAsGroup(fieldNumber, value, schema, repeated);
            return;
        }

        writeTag(fieldNumber, WireFormat.WIRETYPE_LENGTH_DELIMITED);
        ComputedSizeOutput cs = computedSize;
        int last = cs.getSize();
        schema.writeTo(cs, value);
        writeRawVarint32(cs.getSize() - last);
        schema.writeTo(this, value);
    }
Encode a ZigZag-encoded 64-bit value. ZigZag encodes signed integers into values that can be efficiently encoded
with varint. (Otherwise, negative values must be sign-extended to 64 bits to be varint encoded, thus always
taking 10 bytes on the wire.)

@param n
           A signed 64-bit integer.
@return An unsigned 64-bit integer, stored in a signed int because Java has no explicit unsigned support.
protostuff-core/src/test/java/io/protostuff/CodedOutput.java