Code example for MappedByteBuffer

Methods: position

0
 
        // Create a new mutable bitmap to load the bitmap from the file 
        bitmap = Bitmap.createBitmap(width, height, bitmap.getConfig());
 
        // Load it back from the temporary buffer 
        buffer.position(0);
        bitmap.copyPixelsFromBuffer(buffer);
 
        // Cleanup 
        channel.close();
        randomAccessFile.close();
        tmpFile.delete();
 
        return bitmap;
    } 
 
    /** 
     * List of EXIF tags used by {@link #copyExifTags(File, File)}. 
     */ 
    //@formatter:off 
    @SuppressLint("InlinedApi")