public static <T> int writeDelimitedTo(final OutputStream out, final T message,
            final Schema<T> schema, final LinkedBuffer buffer) throws IOException
    {
        if (buffer.start != buffer.offset)
            throw new IllegalArgumentException("Buffer previously used and had not been reset.");

        final ProtostuffOutput output = new ProtostuffOutput(buffer);
        schema.writeTo(output, message);
        ProtobufOutput.writeRawVarInt32Bytes(out, output.size);
        LinkedBuffer.writeTo(out, buffer);
        return output.size;
    }
Serializes the {@code message}, prefixed with its length, into an {@link OutputStream}.

@return the size of the message
protostuff-core/src/main/java/io/protostuff/ProtostuffIOUtil.java