Class MemoryHlsClearKeyCache

    • Constructor Detail

      • MemoryHlsClearKeyCache

        public MemoryHlsClearKeyCache()
        Create an empty cache with a size of DEFAULT_CACHE_SIZE
      • MemoryHlsClearKeyCache

        public MemoryHlsClearKeyCache​(@Nullable
                                      Map<Uri,​byte[]> cache)
        Create a cache with a size of DEFAULT_CACHE_SIZE and pre-filled with the provided Map.
        Parameters:
        cache - Existing entries to pre-fill the cache with
      • MemoryHlsClearKeyCache

        public MemoryHlsClearKeyCache​(int maxCacheSize,
                                      @Nullable
                                      Map<Uri,​byte[]> cache)
        Creates a cache with a size of maxCacheSize and pre-filled with the provided Map.
        Parameters:
        maxCacheSize - Maximum size of the cache
        cache - Existing entries to pre-fill the cache with
    • Method Detail

      • get

        @Nullable
        public byte[] get​(@Nullable
                          Uri uri)
        Description copied from class: HlsClearKeyCache
        Returns the encryptionKey cached against this uri, or null if uri is null or not present in the cache.
        Specified by:
        get in class HlsClearKeyCache
      • put

        @Nullable
        public byte[] put​(@NonNull
                          Uri uri,
                          @NonNull
                          byte[] encryptionKey)
        Description copied from class: HlsClearKeyCache
        Inserts an entry into the cache.
        Specified by:
        put in class HlsClearKeyCache
      • remove

        @Nullable
        public byte[] remove​(@NonNull
                             Uri uri)
        Description copied from class: HlsClearKeyCache
        Removes uri from the cache. If uri was present in the cahce, this returns the corresponding encryptionKey, otherwise null.
        Specified by:
        remove in class HlsClearKeyCache