Convert a JPEG file in to BMP(BitMap)

Dear All,

       I have a problem of converting a JPEG file in to BMP file. I have a array of bytes created from JPEG file. I mean whole file bytes are readed in to array. Know i want to convert that array in to bitmap (BMP) file.

Thanks In Advance.

i recommend using the ImageIO functions for that.

import javax.imageio.ImageIO.read( … );

import javax.imageio.ImageIO.write( … );

Thanks,

        I have tried using same but whatever i am getting is different from my existing c++ code. I have existing c++ library that decompress JPEG data. Know i want to convert it in to java.

By using the IMageIO-API you can get BufferedImages… Those images have a raster with all the sample data your c/c++ lib would have decoded. You shouldn’t have to write a decode-lib by your own or even port one to java cause there are so much good ones out there.