Sounds simple right? Use
ImageIO.read(new ByteArrayInputStream(bytes));
Here's the wrinkle. For some reason it is detecting a jpeg as a bmp, and that is the first ImageReader returned when I call
ImageInputStream iis = ImageIO.createImageInputStream(new ByteArrayInputStream(bytes));
Iterator<ImageReader> readers=ImageIO.getImageReaders(iis);
This causes the image to come out corrupted. Is there a way to tell through java short of looking directly at the bytes for the header, and failing that does anyone know of a good reference for the byte headers for the different images?
Just letting you guys know I am still working on this. I'll let you know if/when I have an answer. I thank all of you for your responses so far.