public static <T> void writeTo(OutputStream out, T message, 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.");
        }

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

        LinkedBuffer objectHeader = output.writeStartObject();
        schema.writeTo(output, message);

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

        output.writeEndObject(objectHeader);

        LinkedBuffer.writeTo(out, buffer);
    }
Serializes the {@code message} into an {@link OutputStream} via {@link JsonXOutput} using the given
{@code schema}.
protostuff-msgpack/src/main/java/io/protostuff/MsgpackXIOUtil.java