Code example for FileOutputStream

Methods: close, flush

0
				folder = Environment.getExternalStorageDirectory();
			} 
			 
			File imageFile = new File(folder, "c2i_" + date.toString() + ".png");
 
			FileOutputStream out = new FileOutputStream(imageFile);
			bmp.compress(Bitmap.CompressFormat.PNG, 100, out);
			out.flush();
			out.close();
 
			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. */ 
	private void scanPhoto(File imageFile)