Search in sources :

Example 1 with HttpUrlFetcher

use of com.bumptech.glide.load.data.HttpUrlFetcher in project glide by bumptech.

the class HttpGlideUrlLoader method buildLoadData.

@Override
public LoadData<InputStream> buildLoadData(GlideUrl model, int width, int height, Options options) {
    // GlideUrls memoize parsed URLs so caching them saves a few object instantiations and time
    // spent parsing urls.
    GlideUrl url = model;
    if (modelCache != null) {
        url = modelCache.get(model, 0, 0);
        if (url == null) {
            modelCache.put(model, 0, 0, model);
            url = model;
        }
    }
    int timeout = options.get(TIMEOUT);
    return new LoadData<>(url, new HttpUrlFetcher(url, timeout));
}
Also used : HttpUrlFetcher(com.bumptech.glide.load.data.HttpUrlFetcher) GlideUrl(com.bumptech.glide.load.model.GlideUrl)

Aggregations

HttpUrlFetcher (com.bumptech.glide.load.data.HttpUrlFetcher)1 GlideUrl (com.bumptech.glide.load.model.GlideUrl)1