static ArrayWrapper newArrayWrapper(Input input, Schema<?> schema,
            boolean mapped, IdStrategy strategy) throws IOException
    {
        final Class<?> componentType = strategy.resolveArrayComponentTypeFrom(
                input, mapped);

        if (input.readFieldNumber(schema) != ID_ARRAY_LEN)
            throw new ProtostuffException("Corrupt input.");
        final int len = input.readUInt32();

        if (input.readFieldNumber(schema) != ID_ARRAY_DIMENSION)
            throw new ProtostuffException("Corrupt input.");
        final int dimensions = input.readUInt32();

        if (dimensions == 1)
            return new ArrayWrapper(Array.newInstance(componentType, len));

        final int[] arg = new int[dimensions];
        arg[0] = len;
        return new ArrayWrapper(Array.newInstance(componentType, arg));
    }
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