| java.lang.Object | |
| ↳ | com.neomades.content.image.FileImageCache |
LRU Disk Image cache with size limit (by default 8MB)
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
FileImageCache(File dir)
Creates a file image cache with 8 M-Bytes of Last-Recent-Used images.
| |||||||||||
|
FileImageCache(File dir, int maxSize)
Creates a file image cache with a user-defined cache size of Last-Recent-Used
images.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| void |
clear()
Clears the file image cache.
| ||||||||||
| void |
close()
Closes the file cache.
| ||||||||||
| Image |
getImage(String url)
Reads the
Image from cache for the URL given in parameter. | ||||||||||
| InputStream |
getImageAsStream(String url)
Reads the image stream from cache for the URL given in parameter.
| ||||||||||
| void |
putImage(String url, Image bitmap)
Saves an image to the cache.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.neomades.content.image.ImageCache
| |||||||||||
Creates a file image cache with 8 M-Bytes of Last-Recent-Used images.
Do not use the same directory with different caches of FileCache and FileImageCache or other stuffs. FileImageCache will delete all the files which is not a file handled by this cache.
Creates a file image cache with a user-defined cache size of Last-Recent-Used images.
| dir | directory to save images |
|---|---|
| maxSize | size in KB |
Clears the file image cache.
Reads the Image from cache for the URL given in parameter.
Reads the image stream from cache for the URL given in parameter.