Code example for MappedByteBuffer

Methods: position

0
				result.copyPixelsToBuffer(map);
				// recycle the source bitmap, this will be no longer used. 
				result.recycle();
				// Create a new bitmap to load the bitmap again. 
				result = Bitmap.createBitmap(width, height, Config.ARGB_8888);
				map.position(0);
				// load it back from temporary 
				result.copyPixelsFromBuffer(map);
				// close the temporary file and channel , then delete that also 
				channel.close();
				randomAccessFile.close();
				file.delete();
			} 
 
			int orientation = getExifOrientation(cr, uri);
			if (orientation != 0) result = rotate(result, orientation);
 
			return result;
		} catch (Exception ex) {
			Log.e(TAG, "Got oom exception ", ex);
			return null;