private void saveBitmap(Bitmap bitmap, File outFile) throws IOException {
        FileOutputStream fos = new FileOutputStream(outFile);
        bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos);
        try {
            fos.flush();
        } finally {
            try {
                if (fos != null) {
                    fos.close();
                }
            } catch (IOException e) {
                BoxingLog.d("IOException when saving a bitmap");
            }
        }
    }
@param file file to compress.
@param maxsize the proximate max size for compression, not for the image with large ratio.
@return may be a little bigger than expected for performance.
boxing/src/main/java/com/bilibili/boxing/utils/ImageCompressor.java