efficient image loading
EDIT: sorry this is in the wrong forum. I thought JAI was the standard javax.imagio API but I don't know how to take this topic down
I'm trying to find out how to load a bunch of images efficiently in terms of memory. Is there any way using JAI to specify a byte  as the target of a reading operation? And to reuse the same byte  for subsequent reads? I'm trying to do this by :
-allocating a byte  b
-creating a DataBuffer db backed by b
-creating a BufferedImage bi backed by db
-creating a param object p for an ImageReader with the destination set to bi
-reading the image with p thus filling b with raw data
So far, the read operation fails with the exception : "ImageReadParam num source & dest bands differ!"
Even if I knew what this meant, I get a feeling that there will be a bunch of other problems down the line, for instance the SampleModel given to create the DataBuffer object asks for dimensions which are unknown in advance.
This question could be summarized by : Is it possible to read an encoded image directly to a byte array with the decoded data in some specified format (ARGB in 4 bytes for instance) without using intermediate buffers at all.
If JAI can not do this, does anyone know of a lib that can?
Thanks for any help on this,