com.bumptech.glide.load.data.StreamAssetPathFetcher 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.data;
import android.content.res.AssetManager;
import androidx.annotation.NonNull;
import java.io.IOException;
import java.io.InputStream;
/** Fetches an {@link java.io.InputStream} for an asset path. */
public class StreamAssetPathFetcher extends AssetPathFetcher {
public StreamAssetPathFetcher(AssetManager assetManager, String assetPath) {
super(assetManager, assetPath);
}
@Override
protected InputStream loadResource(AssetManager assetManager, String path) throws IOException {
return assetManager.open(path);
}
@Override
protected void close(InputStream data) throws IOException {
data.close();
}
@NonNull
@Override
public Class getDataClass() {
return InputStream.class;
}
}