Package com.castlabs.sdk.thumbs
Class CachedThumbnailLoader
- java.lang.Object
-
- com.castlabs.sdk.thumbs.CachedThumbnailLoader
-
public class CachedThumbnailLoader extends Object
ThumbnailLoaderimplementation that delegates to another loader instance and caches the loaded data on disk.- Since:
- 4.0.0
-
-
Constructor Summary
Constructors Constructor Description CachedThumbnailLoader(com.castlabs.sdk.thumbs.ThumbnailLoader delegate, boolean cleanOnDispose)Create a new instance that will delegate to the parent loader that will useContext.getCacheDir()to cache the data.CachedThumbnailLoader(com.castlabs.sdk.thumbs.ThumbnailLoader delegate, File cacheDir, boolean cleanOnDispose)Create a new instance that will delegate to the parent loader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()booleanisStreamingSupported()byte[]load(Uri uri)InputStreamloadStream(Uri uri)
-
-
-
Constructor Detail
-
CachedThumbnailLoader
public CachedThumbnailLoader(@NonNull com.castlabs.sdk.thumbs.ThumbnailLoader delegate, boolean cleanOnDispose)Create a new instance that will delegate to the parent loader that will useContext.getCacheDir()to cache the data.- Parameters:
delegate- The delegatecleanOnDispose- If true, cached data will be deleted when this loader is disposed
-
CachedThumbnailLoader
public CachedThumbnailLoader(@NonNull com.castlabs.sdk.thumbs.ThumbnailLoader delegate, @NonNull File cacheDir, boolean cleanOnDispose)Create a new instance that will delegate to the parent loader.- Parameters:
delegate- The delegatecacheDir- The folder that will be used to cache datacleanOnDispose- If true, cached data will be deleted when this loader disposed
-
-