DataFetcher

interface DataFetcher<T>

Lazily retrieves data that can be used to load a resource.

A new instance is created per resource load by . loadData may or may not be called for any given load depending on whether or not the corresponding resource is cached. Cancel also may or may not be called. If loadData} is called, then so cleanup will be called.

Parameters

<T>

The type of data to be loaded (InputStream, byte[], File etc).

Types

Link copied to clipboard
interface DataCallback<T>
Callback that must be called when data has been loaded and is available, or when the load fails.

Functions

Link copied to clipboard
abstract fun cancel()
A method that will be called when a load is no longer relevant and has been cancelled.
Link copied to clipboard
abstract fun cleanup()
Cleanup or recycle any resources used by this data fetcher.
Link copied to clipboard
abstract fun getDataClass(): Class<T>
Returns the class of the data this fetcher will attempt to obtain.
Link copied to clipboard
abstract fun getDataSource(): DataSource
Returns the com.bumptech.glide.load.DataSource this fetcher will return data from.
Link copied to clipboard
abstract fun loadData(priority: Any, callback: DataFetcher.DataCallback<out Any>)
Fetch data from which a resource can be decoded.

Inheritors

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard