com.octo.android.robospice.persistence.binary
Class InFileBitmapObjectPersister

java.lang.Object
  extended by com.octo.android.robospice.persistence.ObjectPersister<T>
      extended by com.octo.android.robospice.persistence.file.InFileObjectPersister<android.graphics.Bitmap>
          extended by com.octo.android.robospice.persistence.binary.InFileBitmapObjectPersister
All Implemented Interfaces:
CacheCleaner, Persister

public class InFileBitmapObjectPersister
extends InFileObjectPersister<android.graphics.Bitmap>

Stores and retrieves bitmaps to/from file system. Support custom BitmapFactory.Options to lower disk usage.

Author:
David Stemmer

Constructor Summary
InFileBitmapObjectPersister(android.app.Application application)
           
InFileBitmapObjectPersister(android.app.Application application, File cacheFolder)
           
 
Method Summary
 android.graphics.Bitmap.CompressFormat getCompressFormat()
           
 android.graphics.BitmapFactory.Options getDecodingOptions()
           
 int getQuality()
           
protected  android.graphics.Bitmap readCacheDataFromFile(File file)
           
 android.graphics.Bitmap saveDataToCacheAndReturnData(android.graphics.Bitmap data, Object cacheKey)
           
 void setCompressFormat(android.graphics.Bitmap.CompressFormat compressFormat)
           
 void setDecodingOptions(android.graphics.BitmapFactory.Options decodingOptions)
           
 void setQuality(int quality)
           
 
Methods inherited from class com.octo.android.robospice.persistence.file.InFileObjectPersister
fromKey, getAllCacheKeys, getCacheFile, getCacheFolder, getCachePrefix, getCreationDateInCache, getKeySanitizer, isCachedAndNotExpired, isCachedAndNotExpired, isDataInCache, isUsingKeySanitizer, loadAllDataFromCache, loadDataFromCache, removeAllDataFromCache, removeDataFromCache, setCacheFolder, setKeySanitizer, toKey
 
Methods inherited from class com.octo.android.robospice.persistence.ObjectPersister
canHandleClass, getApplication, getHandledClass, isAsyncSaveEnabled, setAsyncSaveEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InFileBitmapObjectPersister

public InFileBitmapObjectPersister(android.app.Application application)
                            throws CacheCreationException
Throws:
CacheCreationException

InFileBitmapObjectPersister

public InFileBitmapObjectPersister(android.app.Application application,
                                   File cacheFolder)
                            throws CacheCreationException
Throws:
CacheCreationException
Method Detail

readCacheDataFromFile

protected android.graphics.Bitmap readCacheDataFromFile(File file)
                                                 throws CacheLoadingException
Specified by:
readCacheDataFromFile in class InFileObjectPersister<android.graphics.Bitmap>
Throws:
CacheLoadingException

saveDataToCacheAndReturnData

public android.graphics.Bitmap saveDataToCacheAndReturnData(android.graphics.Bitmap data,
                                                            Object cacheKey)
                                                     throws CacheSavingException
Specified by:
saveDataToCacheAndReturnData in class ObjectPersister<android.graphics.Bitmap>
Throws:
CacheSavingException

getDecodingOptions

public android.graphics.BitmapFactory.Options getDecodingOptions()

setDecodingOptions

public void setDecodingOptions(android.graphics.BitmapFactory.Options decodingOptions)

getCompressFormat

public android.graphics.Bitmap.CompressFormat getCompressFormat()

setCompressFormat

public void setCompressFormat(android.graphics.Bitmap.CompressFormat compressFormat)

getQuality

public int getQuality()

setQuality

public void setQuality(int quality)


Copyright © 2012-2014. All Rights Reserved.