Class CacheSpan
- java.lang.Object
-
- com.google.android.exoplayer2.upstream.cache.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 byisCached
).
-
-
Field Summary
Fields Modifier and Type Field Description File
file
Deprecated.boolean
isCached
Deprecated.Whether theCacheSpan
is cached.String
key
Deprecated.The cache key that uniquely identifies the resource.long
lastTouchTimestamp
Deprecated.The last touch timestamp, orC.TIME_UNSET
ifisCached
is false.long
length
Deprecated.The length of theCacheSpan
, orC.LENGTH_UNSET
if this is an open-ended hole.long
position
Deprecated.The position of theCacheSpan
in the resource.
-
Constructor Summary
Constructors Constructor Description 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.CacheSpan(String key, long position, long length, long lastTouchTimestamp, File file)
Deprecated.Creates a CacheSpan.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
compareTo(CacheSpan another)
Deprecated.boolean
isHoleSpan()
Deprecated.Returns whether this is a holeCacheSpan
.boolean
isOpenEnded()
Deprecated.Returns whether this is an open-endedCacheSpan
.String
toString()
Deprecated.
-
-
-
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 theCacheSpan
in the resource.
-
length
public final long length
Deprecated.The length of theCacheSpan
, orC.LENGTH_UNSET
if this is an open-ended hole.
-
isCached
public final boolean isCached
Deprecated.Whether theCacheSpan
is cached.
-
file
@Nullable public final File file
Deprecated.
-
lastTouchTimestamp
public final long lastTouchTimestamp
Deprecated.The last touch timestamp, orC.TIME_UNSET
ifisCached
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 theCacheSpan
in the resource.length
- The length of theCacheSpan
, orC.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 theCacheSpan
in the resource.length
- The length of theCacheSpan
, orC.LENGTH_UNSET
if this is an open-ended hole.lastTouchTimestamp
- The last touch timestamp, orC.TIME_UNSET
ifisCached
is false.file
- The file corresponding to thisCacheSpan
, or null if it's a hole.
-
-
Method Detail
-
isOpenEnded
public boolean isOpenEnded()
Deprecated.Returns whether this is an open-endedCacheSpan
.
-
isHoleSpan
public boolean isHoleSpan()
Deprecated.Returns whether this is a holeCacheSpan
.
-
compareTo
public int compareTo(CacheSpan another)
Deprecated.- Specified by:
compareTo
in interfaceComparable<CacheSpan>
-
-