|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bumptech.glide.load.engine.cache.DiskLruCacheWrapper
public class DiskLruCacheWrapper
The default DiskCache implementation. There must be no more than one active instance for a given directory at a time.
get(java.io.File, int)
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.bumptech.glide.load.engine.cache.DiskCache |
---|
DiskCache.Factory, DiskCache.Writer |
Constructor Summary | |
---|---|
protected |
DiskLruCacheWrapper(File directory,
int maxSize)
|
Method Summary | |
---|---|
void |
clear()
Clear the cache. |
void |
delete(Key key)
Remove the key and value from the cache. |
static DiskCache |
get(File directory,
int maxSize)
Get a DiskCache in the given directory and size. |
File |
get(Key key)
Get the cache for the value at the given key. |
void |
put(Key key,
DiskCache.Writer writer)
Write to a key in the cache. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected DiskLruCacheWrapper(File directory, int maxSize)
Method Detail |
---|
public static DiskCache get(File directory, int maxSize)
directory
- The directory for the disk cachemaxSize
- The max size for the disk cache
public File get(Key key)
DiskCache
Note - This is potentially dangerous, someone may write a new value to the file at any point in timeand we won't know about it.
get
in interface DiskCache
key
- The key in the cache.
public void put(Key key, DiskCache.Writer writer)
DiskCache
DiskCache.Writer
is used so that the cache implementation can perform actions after
the write finishes, like commit (via atomic file rename).
put
in interface DiskCache
key
- The key to write to.writer
- An interface that will write data given an OutputStream for the key.public void delete(Key key)
DiskCache
delete
in interface DiskCache
key
- The key to remove.public void clear()
DiskCache
clear
in interface DiskCache
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |