private static void writePixel(ByteBuffer buf, int idx, int pixel, int bpp){
        buf.position(idx);
        while ((--bpp) >= 0){
//            pixel = pixel >> 8;
            byte bt = (byte) ((pixel >> (bpp * 8)) & 0xff);
//            buf.put( (byte) (pixel & 0xff) );
            buf.put(bt);
        }
    }
A private constructor to inhibit instantiation of this class.
jme3-desktop/src/main/java/jme3tools/converters/ImageToAwt.java