code: public static File storeOnCacheDir(Context context, Bitmap bitmap, String path, String filename, Bitmap.CompressFormat format, int quality) {
          File dir = new File(context.getCacheDir(), path);
          FileUtils.makeDirsIfNeeded(dir);
          File file = new File(dir, filename);
          if (!storeAsFile(bitmap, file, format, quality)) {
              return null;
          }
          return file;
      }
docs: Store the bitmap on the cache directory path.
  @param context the context.
  @param bitmap to store.
  @param path file path.
  @param filename file name.
  @param format bitmap format.
  @param quality the quality of the compressed bitmap.
  @return the compressed bitmap file.