[jruby-user] Reading binary Files

Roger Palma <[email protected]>
Newsgroups gmane.comp.lang.jruby.user
Message-ID <[email protected]>
Hi there
I am trying to read a binary file using Java's "FileInputStream" to
later store it in HBase.

My problem is the byte-array conversion needed to call the read-method:

inFile = File.new("/home/roger/Downloads/test.jpg")
inputStream = FileInputStream.new(inFile)

length = inFile.length()
buffer = ""

inputStream.read(buffer)


Any Ideas?

You may find the entire code in the attachment.

Thanks
Roger

Attachments:
http://www.ruby-forum.com/attachment/10139/test.rb


-- 
Posted via http://www.ruby-forum.com/.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.