Package com.castlabs.sdk.thumbs

## Class CachedThumbnailLoader

- java.lang.Object
- - com.castlabs.sdk.thumbs.CachedThumbnailLoader

-     public class CachedThumbnailLoader
      extends Object

  `ThumbnailLoader` implementation 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 use `Context.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
    --- | --- | ---
    `void` | `dispose()` |
    `boolean` | `isStreamingSupported()` |
    `byte[]` | `load​(Uri uri)` |
    `InputStream` | `loadStream​(Uri uri)` |

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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 use `Context.getCacheDir()` to cache the data.
      Parameters:
        `delegate` - The delegate
        `cleanOnDispose` - 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 delegate
        `cacheDir` - The folder that will be used to cache data
        `cleanOnDispose` - If true, cached data will be deleted when this loader disposed

  - ### Method Detail

    - #### isStreamingSupported

          public boolean isStreamingSupported()

    - #### loadStream

          public InputStream loadStream​(Uri uri)
                                 throws Exception

      Throws:
        `Exception`

    - #### load

          public byte[] load​(Uri uri)
                      throws Exception

      Throws:
        `Exception`

    - #### dispose

          public void dispose()