7 Replies Latest reply: May 1, 2014 5:15 AM by jwenting RSS

    how to convert byte array to jpg file using java.

    7d842125-81b7-4ac4-968d-3bb4f4b96089

      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();