Class CacheSpan

  • All Implemented Interfaces:
    Comparable<CacheSpan>

    @Deprecated
    public class CacheSpan
    extends Object
    implements Comparable<CacheSpan>
    Deprecated.
    com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
    Defines a span of data that may or may not be cached (as indicated by isCached).
    • Field Detail

      • key

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

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

        public final long length
        Deprecated.
        The length of the CacheSpan, or C.LENGTH_UNSET if this is an open-ended hole.
      • isCached

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

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

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

      • CacheSpan

        public CacheSpan​(String key,
                         long position,
                         long length)
        Deprecated.
        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)
        Deprecated.
        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.
    • Method Detail

      • isOpenEnded

        public boolean isOpenEnded()
        Deprecated.
        Returns whether this is an open-ended CacheSpan.
      • isHoleSpan

        public boolean isHoleSpan()
        Deprecated.
        Returns whether this is a hole CacheSpan.