import java.awt.*; import java.awt.image.*; import javax.imageio.ImageIO; import java.io.File; import java.io.IOException; class JPGwks { static void pl(String m){System.out.println(m);} static void pb(byte[] x){for(int k=0; k"+((wr.getDataElements(0, 0, null)).getClass()).getCanonicalName()+"<"); {String tp = ((wr.getDataElements(0, 0, null)).getClass()).getCanonicalName(); if(!sc(tp, "byte[]")) { pl("wrong type: >"+ tp + "<"); return;}} pl("Has "+((byte[])wr.getDataElements(0, 0, null)).length+" bytes."); for(int i=0; i<2; ++i) for(int j=0; j<5; ++j) { pb((byte[])wr.getDataElements(i, j, null));} {DataBuffer db = wr.getDataBuffer(); pl("DataType = "+db.getDataType() +"; Size = "+db.getSize() +"; DataTypeSize = "+db.getDataTypeSize(db.TYPE_BYTE) +" bits; Offsets = "); pi(db.getOffsets()); System.out.print("first elements = "); for(int j = 0; j<5; ++j) System.out.print(" "+db.getElem(j)); pl("");} new JPGwks().mutate(wr); try {ImageIO.write(I, "jpg", new File(args[1]));} catch (IOException e) {System.err.println("image not saved.");}} catch (IOException e) {System.err.println("File not read.");}} static {System.loadLibrary("JPGwks");}}