Roger Palma
2014-10-04 21:38:25 UTC
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
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
Posted via http://www.ruby-forum.com/.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email