static Class<?> getArrayClass(Input input, Schema<?> schema,
            final Class<?> componentType) throws IOException
    {
        if (input.readFieldNumber(schema) != ID_ARRAY_DIMENSION)
            throw new ProtostuffException("Corrupt input.");
        final int dimensions = input.readUInt32();

        // TODO is there another way (reflection) to obtain an array class?

        if (dimensions == 1)
            return Array.newInstance(componentType, 0).getClass();

        final int[] arg = new int[dimensions];
        arg[0] = 0;
        return Array.newInstance(componentType, arg).getClass();
    }
A schema for dynamic types (fields where the type is {@link Object}).

@author David Yu
@created Feb 1, 2011
protostuff-runtime/src/main/java/io/protostuff/runtime/ObjectSchema.java