com.bumptech.glide.load.model.stream.StreamFileLoader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of glide Show documentation
Show all versions of glide Show documentation
A fast and efficient image loading library for Android focused on smooth scrolling.
package com.bumptech.glide.load.model.stream;
import android.content.Context;
import android.net.Uri;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.model.FileLoader;
import com.bumptech.glide.load.model.GenericLoaderFactory;
import com.bumptech.glide.load.model.ModelLoader;
import com.bumptech.glide.load.model.ModelLoaderFactory;
import java.io.File;
import java.io.InputStream;
/**
* A {@link ModelLoader} For translating {@link File} models for local uris into {@link InputStream} data.
*/
public class StreamFileLoader extends FileLoader implements StreamModelLoader {
/**
* The default factory for {@link com.bumptech.glide.load.model.stream.StreamFileLoader}s.
*/
public static class Factory implements ModelLoaderFactory {
@Override
public ModelLoader build(Context context, GenericLoaderFactory factories) {
return new StreamFileLoader(factories.buildModelLoader(Uri.class, InputStream.class));
}
@Override
public void teardown() {
// Do nothing.
}
}
public StreamFileLoader(Context context) {
this(Glide.buildStreamModelLoader(Uri.class, context));
}
public StreamFileLoader(ModelLoader uriLoader) {
super(uriLoader);
}
}