Class StreamAssetPathFetcher

  • All Implemented Interfaces:
    DataFetcher<java.io.InputStream>

    public class StreamAssetPathFetcher
    extends AssetPathFetcher<java.io.InputStream>
    Fetches an InputStream for an asset path.
    • Constructor Summary

      Constructors 
      Constructor Description
      StreamAssetPathFetcher​(android.content.res.AssetManager assetManager, java.lang.String assetPath)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void close​(java.io.InputStream data)
      Closes the concrete data type if necessary.
      java.lang.Class<java.io.InputStream> getDataClass()
      Returns the class of the data this fetcher will attempt to obtain.
      protected java.io.InputStream loadResource​(android.content.res.AssetManager assetManager, java.lang.String path)
      Opens the given asset path with the given AssetManager and returns the concrete data type returned by the AssetManager.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StreamAssetPathFetcher

        public StreamAssetPathFetcher​(android.content.res.AssetManager assetManager,
                                      java.lang.String assetPath)
    • Method Detail

      • loadResource

        protected java.io.InputStream loadResource​(android.content.res.AssetManager assetManager,
                                                   java.lang.String path)
                                            throws java.io.IOException
        Description copied from class: AssetPathFetcher
        Opens the given asset path with the given AssetManager and returns the concrete data type returned by the AssetManager.
        Specified by:
        loadResource in class AssetPathFetcher<java.io.InputStream>
        Parameters:
        assetManager - An AssetManager to use to open the given path.
        path - A string path pointing to a resource in assets to open.
        Throws:
        java.io.IOException
      • close

        protected void close​(java.io.InputStream data)
                      throws java.io.IOException
        Description copied from class: AssetPathFetcher
        Closes the concrete data type if necessary.
        Specified by:
        close in class AssetPathFetcher<java.io.InputStream>
        Parameters:
        data - The data to close.
        Throws:
        java.io.IOException
      • getDataClass

        @NonNull
        public java.lang.Class<java.io.InputStream> getDataClass()
        Description copied from interface: DataFetcher
        Returns the class of the data this fetcher will attempt to obtain.