@Override
            public void writeTo(Output output, Object message) throws IOException
            {
                final Object[] array = (Object[])message;
                final boolean preserveNull = IdStrategy.this.preserveNull;
                int nullCount = 0;
                for (Object value : array)
                {
                    if (value != null)
                    {
                        if (nullCount != 0)
                        {
                            output.writeUInt32(2, nullCount, false);
                            nullCount = 0;
                        }
                        output.writeObject(1, value, DYNAMIC_VALUE_SCHEMA, true);
                    }
                    else if (preserveNull)
                    {
                        nullCount++;
                    }
                }
                if (nullCount != 0)
                    output.writeUInt32(2, nullCount, false);
            }
This base class handles all the IO for reading and writing polymorphic fields. When a field's type is
polymorphic/dynamic (e.g interface/abstract/object), the type (id) needs to be written (ahead) before its
value/content to be able to deserialize it correctly.
<p>
The underlying impl will determine how the type (id) should be written.
<p>
An {@link IdStrategy} is standalone if the {@link #primaryGroup} is not set.

@author Leo Romanoff
@author David Yu
protostuff-runtime/src/main/java/io/protostuff/runtime/IdStrategy.java