public static final ByteBuffer getImageDataFromImage(BufferedImage bufferedImage) {
        WritableRaster wr;
        DataBuffer db;

        BufferedImage bi = new BufferedImage(128, 64, BufferedImage.TYPE_INT_ARGB);
        Graphics2D g = bi.createGraphics();
        g.drawImage(bufferedImage, null, null);
        bufferedImage = bi;
        wr = bi.getRaster();
        db = wr.getDataBuffer();

        DataBufferInt dbi = (DataBufferInt) db;
        int[] data = dbi.getData();

        ByteBuffer byteBuffer = ByteBuffer.allocateDirect(data.length * 4);
        byteBuffer.order(ByteOrder.LITTLE_ENDIAN);
        byteBuffer.asIntBuffer().put(data);
        byteBuffer.flip();

        return byteBuffer;
    }
A private constructor to inhibit instantiation of this class.
jme3-terrain/src/main/java/com/jme3/terrain/noise/ShaderUtils.java