Code example for FileOutputStream

Methods: closeflush

				folder = Environment.getExternalStorageDirectory();
			File imageFile = new File(folder, "c2i_" + date.toString() + ".png");
			FileOutputStream out = new FileOutputStream(imageFile);
			bmp.compress(Bitmap.CompressFormat.PNG, 100, out);
			retVal = imageFile;
		} catch (Exception e) {
			Log.e("Canvas2ImagePlugin", "An exception occured while saving image: "
					+ e.toString());
		return retVal;
	/* Invoke the system's media scanner to add your photo to the Media Provider's database,  
	 * making it available in the Android Gallery application and to other apps. */ 
Experience pair programming with AI  Get Codota for Java