A String.from_java_bytes Equivalent?

I am looking at the following blog posting where someone is using jruby
and iText to create a pdf file and then sending it to the browser :

I am using only ruby / on rails.

I would like to do precisely this in ROR and I can get to the second
last line :

    document.close <<<--- I can get this document and the m
    send_data String.from_java_bytes(m.toByteArray),
         :type=> "application/pdf", :dispostion=>"inline"

but I dont know how to send_data to the browser with the document and
byetarraystream available.

I think I may have figured this out.

to pass data to the send_data method you just need to send it the
.toByteArray() output and no need to do a String.from_java_bytes!!

So I can bypass the from_java_bytes in my case...

Ather Shiraz wrote: