protected void writeImageFile(File file) throws IOException {
        OutputStream outStream = new FileOutputStream(file);
        try {
            JmeSystem.writeImageFile(outStream, "png", outBuf, width, height);
        } finally {
            outStream.close();
        }
    }
Called by postFrame() once the screen has been captured to outBuf.

@param file the output file
@throws IOException if an I/O error occurs
jme3-screenshot-tests/src/main/java/org/jmonkeyengine/screenshottests/testframework/ScreenshotNoInputAppState.java