private void writeWithNullTo(Output output, Collection<V> message) throws IOException
    {
        int nullCount = 0;
        for (V value : message)
        {
            if (value != null)
            {
                if (nullCount != 0)
                {
                    output.writeUInt32(2, nullCount, false);
                    nullCount = 0;
                }
                writeValueTo(output, 1, value, true);
            }
            else
            {
                nullCount++;
            }
        }
        if (nullCount != 0)
            output.writeUInt32(2, nullCount, false);
    }
Transfers the value from the input to the output.
protostuff-collectionschema/src/main/java/io/protostuff/CollectionSchema.java