static void writeObjectTo(Output output, Object value,
            Schema<?> currentSchema, IdStrategy strategy) throws IOException
    {
        final Class<?> c = ((Class<?>) value);
        if (c.isArray())
        {
            int dimensions = 1;
            Class<?> componentType = c.getComponentType();
            while (componentType.isArray())
            {
                dimensions++;
                componentType = componentType.getComponentType();
            }

            strategy.writeClassIdTo(output, componentType, true);
            // write the dimensions of the array
            output.writeUInt32(ID_ARRAY_DIMENSION, dimensions, false);
            return;
        }

        strategy.writeClassIdTo(output, c, false);
    }
Used when a field is declared as {@code Class<?>} (with or with-out generics).

@author David Yu
@created Apr 25, 2012
protostuff-runtime/src/main/java/io/protostuff/runtime/ClassSchema.java