@Override
    @SuppressWarnings("unchecked")
    protected <T> HasDelegate<T> tryWriteDelegateIdTo(Output output, int fieldNumber,
            Class<T> clazz) throws IOException
    {
        final RegisteredDelegate<T> rd = (RegisteredDelegate<T>) delegateMapping.get(
                clazz);

        if (rd == null)
            return null;

        output.writeUInt32(fieldNumber, rd.id, false);

        return rd;
    }
Register a {@link Delegate} and assign an id.
<p>
Delegate ids start at 1.
protostuff-runtime-registry/src/main/java/io/protostuff/runtime/IncrementalIdStrategy.java