} else { bais = new ByteArrayInputStream((byte[])pg.getPixels()); }
    private String checksumImage(Image i) {        PixelGrabber pg = new PixelGrabber(i, 0, 0, -1, -1, false);        Checksum sum = new CRC32();        try {            pg.grabPixels();            ImageInputStream is;            try {                ByteArrayInputStream bais = new ByteArrayInputStream(                        Util.convertIntegersToBytes((int[])pg.getPixels()));                byte[] bytes = new byte[1024];                int len = 0;                while ((len = bais.read(bytes)) >= 0) {                    sum.update(bytes, 0, len);                }            } catch (IOException e) {                e.printStackTrace();            }        } catch (InterruptedException e) {            e.printStackTrace();        }        return Long.toHexString(sum.getValue());    }