for(int i = 0; i < (bh.width + npad) * 3 * bh.height; i++) {
for(int i = 0; i < brgb.length; i++) { if(i + 54>= data.length) { break; }
    public java.awt.Image readMap24(byte[] data, BitmapHeader bh)        throws IOException {        java.awt.Image image;        int npad = (bh.sizeimage / bh.height) - bh.width * 3;        int ndata[] = new int[bh.height * bh.width];        byte brgb[] = new byte[(bh.width + npad) * 3 * bh.height];        for(int i = 0; i < (bh.width + npad) * 3 * bh.height; i++) {            brgb[i] = data[i + 54];        }                int nindex = 0;        for (int j = 0; j < bh.height; j++) {            for (int i = 0; i < bh.width; i++) {                ndata[bh.width * (bh.height - j - 1) + i] =                    constructInt3(brgb, nindex);                nindex += 3;            }            nindex += npad;        }        image =            Toolkit.getDefaultToolkit().createImage(                new MemoryImageSource(bh.width, bh.height, ndata, 0, bh.width));        return image;    }