ImageLruDiskCache

class ImageLruDiskCache(    context: Context,     cacheFolder: String,     maxSizeBytes: Long = 10L * 1024 * 1024,     compressFormat: Bitmap.CompressFormat = CompressFormat.JPEG,     mCompressQuality: Int = 70)

Implementation of disk cache based on DiskLruCache.

See also

com.jakewharton.disklrucache.DiskLruCache

Parameters

cacheFolder

name of the folder that will store the images of this cache. It will create a cache if none exists there.

maxSizeBytes

the maximum number of bytes this cache should use to store

compressFormat

the format to be used when compressing to store the image in cache.

mCompressQuality

the compress quality to be used when compressing to store the image in cache.

Throws

if reading or writing the cache directory fails

Constructors

Link copied to clipboard
fun ImageLruDiskCache(    context: Context,     cacheFolder: String,     maxSizeBytes: Long = 10L * 1024 * 1024,     compressFormat: Bitmap.CompressFormat = CompressFormat.JPEG,     mCompressQuality: Int = 70)

Functions

Link copied to clipboard
fun clearCache()
Link copied to clipboard
fun containsKey(key: String): Boolean
Link copied to clipboard
fun getBitmap(key: String): Bitmap?
Link copied to clipboard
fun put(key: String, data: Bitmap)