public static <T> void writeListTo(OutputStream out, List<T> messages, Schema<T> schema,
            boolean numeric, LinkedBuffer buffer) throws IOException
    {
        if (buffer.start != buffer.offset)
        {
            throw new IllegalArgumentException("Buffer previously used and had not been reset.");
        }

        if (messages.isEmpty())
        {
            return;
        }

        MsgpackXOutput output = new MsgpackXOutput(buffer, numeric, schema);

        for (T m : messages)
        {

            LinkedBuffer objectStarter = output.writeStartObject();
            schema.writeTo(output, m);

            if (output.isLastRepeated())
            {
                output.writeEndArray();
            }

            output.writeEndObject(objectStarter);
            
            LinkedBuffer.writeTo(out, buffer);
            output.clear();
        }
    }
Serializes the {@code messages} into the stream using the given schema with the supplied buffer.
protostuff-msgpack/src/main/java/io/protostuff/MsgpackXIOUtil.java