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

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

public final class InFileBigInputStreamObjectPersister
extends InFileInputStreamObjectPersister

Stores / retrieves data in file system. This ObjectPersister is optimized for memory. It will only use file system to save the data, without allocating large memory space to transfert a given binary to the cache. It should be preferred to InFileInputStreamObjectPersister for low memory devices or memory intensive usages.

Author:
SNI

Constructor Summary
InFileBigInputStreamObjectPersister(android.app.Application application)
           
InFileBigInputStreamObjectPersister(android.app.Application application, File cacheFolder)
           
 
Method Summary
 InputStream saveDataToCacheAndReturnData(InputStream data, Object cacheKey)
           
 void setAsyncSaveEnabled(boolean isAsyncSaveEnabled)
           
 
Methods inherited from class com.octo.android.robospice.persistence.binary.InFileInputStreamObjectPersister
canHandleClass, readCacheDataFromFile
 
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
getApplication, getHandledClass, isAsyncSaveEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InFileBigInputStreamObjectPersister

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

InFileBigInputStreamObjectPersister

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

saveDataToCacheAndReturnData

public InputStream saveDataToCacheAndReturnData(InputStream data,
                                                Object cacheKey)
                                         throws CacheSavingException
Overrides:
saveDataToCacheAndReturnData in class InFileInputStreamObjectPersister
Throws:
CacheSavingException

setAsyncSaveEnabled

public void setAsyncSaveEnabled(boolean isAsyncSaveEnabled)
Overrides:
setAsyncSaveEnabled in class ObjectPersister<InputStream>


Copyright © 2012-2014. All Rights Reserved.