Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to convert byte array to jpg file using java.

2625008Apr 30 2014 — edited May 1 2014

Hi, i have I byte array ,That I was getting from the gps packets , I need to convert that into jpg file please explain me.

public static void writejpegfile(byte[] someByteArray) throws FileNotFoundException, IOException {

       

         FileOutputStream fos = new FileOutputStream("image" + new Date().getTime() + ".jpg")

        try {

        

           fos.write(someByteArray);

//            System.out.println(output);

        } finally {

            System.out.println("image created");

            fos.close();

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 29 2014
Added on Apr 30 2014
7 comments
6,995 views