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