Class CacheSpan

    • Field Detail

      • key

        public final String key
        The cache key that uniquely identifies the resource.
      • position

        public final long position
        The position of the CacheSpan in the resource.
      • isCached

        public final boolean isCached
        Whether the CacheSpan is cached.
      • file

        @Nullable
        public final File file
        The file corresponding to this CacheSpan, or null if isCached is false.
      • lastTouchTimestamp

        public final long lastTouchTimestamp
        The last touch timestamp, or C.TIME_UNSET if isCached is false.
    • Constructor Detail

      • CacheSpan

        public CacheSpan​(String key,
                         long position,
                         long length)
        Creates a hole CacheSpan which isn't cached, has no last touch timestamp and no file associated.
        Parameters:
        key - The cache key that uniquely identifies the resource.
        position - The position of the CacheSpan in the resource.
        length - The length of the CacheSpan, or C.LENGTH_UNSET if this is an open-ended hole.
      • CacheSpan

        public CacheSpan​(String key,
                         long position,
                         long length,
                         long lastTouchTimestamp,
                         @Nullable
                         File file)
        Creates a CacheSpan.
        Parameters:
        key - The cache key that uniquely identifies the resource.
        position - The position of the CacheSpan in the resource.
        length - The length of the CacheSpan, or C.LENGTH_UNSET if this is an open-ended hole.
        lastTouchTimestamp - The last touch timestamp, or C.TIME_UNSET if isCached is false.
        file - The file corresponding to this CacheSpan, or null if it's a hole.