Code example for BufferedOutputStream

Methods: close

0
      } 
    } 
 
    OutputStream fos = null;
    try { 
      fos = new BufferedOutputStream(new FileOutputStream(file));
      bitmap.compress(PNG, 100 /* quality */, fos);
 
      chmodPlusR(file);
    } finally { 
      bitmap.recycle();
      if (fos != null) {
        fos.close();
      } 
    } 
  } 
 
  private static void drawDecorViewToBitmap(Activity activity, Bitmap bitmap) {
    Canvas canvas = new Canvas(bitmap);
    activity.getWindow().getDecorView().draw(canvas);
  }