I have a image file that need to be exposed as stream. So I have written a fs which reads the image from File system and outputs stream as object.
We have a java client which calls this flow service.
Do anybody have any examples of java code in using the stream, convert this stream back to image?
You might want to use the javax.imageio package provided in versions above J2SE 1.4.
Check with your resources about the java version.
Thank you for your details.
What is the best way to transfer an image. I was able to transfer image in bytes and client was able to successfully read the image in our POC.
But We are expecting lots of load with image transfers.
So we want to handle the transfer of these images the best possible way in terms of cosuming less memory and best performance.
Can you provide any suggestions regarding this?
To keep memory usage to a minimum, use streams within IS when retrieving the image file from disk. Depending on how you are passing the bytes to the client, you may be able to avoid loading entire image files into memory.
I am unclear about -->avoid loading entire image files into memory
How can I do that?
In addition to:
- how to avoid loading entire image files into memory
- Can we use any compression mechanisms?
to improve memory usage and performance.