Going from byte[] to Jpeg on disk

Hi everyone,

I want to go from an array of bytes to a file written on disk. I found some ways to do this online, but they were all doing a somewhat roundabout way. (They set up a Graphics2d object to draw the image, pass it through a RenderedImage object, then use ImageIO.write class from the standard IO methods to get it on disk. Is this the best way to do this? Has anyone else found a good, efficient way to go from an array of bytes to a jpeg or gif on disk?

(Also, I should note that I'm on Java 6 and cannot currently upgrade...)

Re: Going from byte[] to Jpeg on disk

I want to go from an array of bytes to a file written on disk

There are several write() methods that take an array of bytes as source for what is written. Which classes have you tried?
Do you have code where you tried to do it that did not work? If so, can you post the code and describe the problems you are having with it?