All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bumptech.glide.load.data.StreamAssetPathFetcher Maven / Gradle / Ivy

Go to download

A fast and efficient image loading library for Android focused on smooth scrolling.

There is a newer version: 5.0.0-rc01
Show newest version
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;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy