private void setup(InputStream stream, int size, int format, boolean swapxy) throws Exception {
        // Verify that filename and size are valid.
        if (null == stream || size <= 0) {
            throw new Exception("Must supply valid stream and "
                    + "size (> 0)");
        }


        this.stream = stream;
        this.size = size;
        this.format = format;
        this.swapXy = swapxy;
        load();
    }
Constructor creates a new <code>RawHeightMap</code> object and loads a
RAW image file to use as a height field. The greyscale image denotes the
height of the terrain, where dark is low point and bright is high point.
The values of the RAW correspond directly with the RAW values or 0 - 255.

@param filename
           the RAW file to use as the heightmap.
@param size
           the size of the RAW (must be square).
@throws Exception
            if the filename is null or not RAW, and if the size is 0 or
            less.
jme3-terrain/src/main/java/com/jme3/terrain/heightmap/RawHeightMap.java