Code example for ByteArrayOutputStream

Methods: toByteArrayflush

0
	} 
 
	public static boolean savePhoto(Activity activity, Bitmap bitmap,
			String fileName) {
		try { 
			ByteArrayOutputStream byteArray = new ByteArrayOutputStream();
			bitmap.compress(Bitmap.CompressFormat.JPEG, 75, byteArray);
			bitmap.recycle();
			ImageManager.writeImage(byteArray.toByteArray(), fileName,
					getPhotoPath(activity));
			byteArray.flush();
			return true; 
		} catch (IOException e) {
			e.printStackTrace();
		} 
		return false; 
	} 
 
	public static Bitmap rotatePhoto(Bitmap bitmap, int rotate) {
		Matrix matrix = new Matrix();
Experience pair programming with AI  Get Codota for Java