I am working on part of a Java application that takes an image as a byte array, reads it into a java.awt.image.BufferedImage instance and passes it to a third-p
java.awt.image.BufferedImage
You can write that image via imageio through an OutputStream to a byte[]. In my code, it looks more or less like this:
imageio
OutputStream
byte[]
byte[] encodeJpegLossless(BufferedImage img){...using imageio...} ... Assert.assertTrue(Arrays.equals(encodeJpegLossless(img1) ,encodeJpegLossless(img2) ) );