I have some code that does:
content = Java::byte[s].new
f = tar.read(content, 0, s)
content_stream = ByteArrayInputStream.new(content)
So far, so good
But when I try to use a method that only takes an InputStream, like so:
metadata = ImageMetadataReader.readMetadata(content_stream)
I get the following exception:
NameError: no method 'readMetadata' for arguments (java.io.ByteArrayInputStream) on Java::ComDrewImaging::ImageMetadataReader
I've tried using content_stream.to_java(java.io.InputStream)
and that still generates the same error. Any ideas?
The single-argument readMetadata() takes a file; there is a two-argument that takes a *Buffered*InputStream and a boolean. You could wrap your ByteArrayInputStream in a BufferedInputStream and decide whether you want to 'waitForBytes', whatever that means...