Code example for MappedByteBuffer

Methods: position

0
	        imgIn.recycle();
	        System.gc(); // try to force the bytes from the imgIn to be released
 
	        // Create a new bitmap to load the bitmap again. Probably the memory will be available.  
	        imgIn = Bitmap.createBitmap(width, height, type);
	        map.position(0);
	         
	        // Load it back from temporary  
	        imgIn.copyPixelsFromBuffer(map);
	         
	        // Close the temporary file and channel, then delete that also 
	        channel.close();
	        randomAccessFile.close();
 
	        // Delete the temp file 
	        file.delete();
 
	    } catch (FileNotFoundException e) {
	        // e.printStackTrace(); 
	    } catch (IOException e) {
	    	// e.printStackTrace();