Code example for FileOutputStream

Methods: close, write

0
					MediaStore.EXTRA_OUTPUT); 
 
			File pictureFile = new File(fileUri.getPath()); 
 
			try { 
				FileOutputStream fos = new FileOutputStream(pictureFile); 
				fos.write(data); 
				fos.close(); 
			} catch (FileNotFoundException e) { 
				Log.d(TAG, "File not found: " + e.getMessage()); 
			} catch (IOException e) { 
				Log.d(TAG, "Error accessing file: " + e.getMessage()); 
			} 
			setResult(RESULT_OK); 
			pressed = false; 
			finish(); 
		} 
	}; 
}