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.");

        final JsonXOutput output = new JsonXOutput(buffer, out, numeric, schema);

        output.writeStartObject();

        schema.writeTo(output, message);

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

        output.writeEndObject();

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