// Get JAFFE database from http://www.kasrl.org/jaffe_info.html
// Extract pics in folder named "jaffe"
// package image_test;

import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;

public class svq {

    public static void main(String[] args) {
        // read image
        BufferedImage input = null;
        try {
            input = ImageIO.read(new File("jaffe/KA.AN1.39.tiff.bmp"));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        System.out.println("Done!");
    }
}
@@ -610,16 +610,289 @@
      %7D%0A%0A
+        // to byte array%0A        ByteArrayOutputStream baos = new ByteArrayOutputStream();%0A        try %7B%0A            ImageIO.write( input, %22bmp%22, baos );%0A            baos.flush();%0A        %7D catch (IOException e) %7B%0A%0A        %7D%0A        byte%5B%5D bytearray = baos.toByteArray();%0A%0A
         

Convert bmp to byte array