Back to Exoplayer

CacheSpan (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/upstream/cache/CacheSpan.html

latest7.6 KB
Original Source

Package com.google.android.exoplayer2.upstream.cache

Class CacheSpan

  • java.lang.Object

    • com.google.android.exoplayer2.upstream.cache.CacheSpan
  • All Implemented Interfaces:Comparable<CacheSpan>


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public classCacheSpanextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[Comparable](https://developer.android.com/reference/java/lang/Comparable.html "class or interface in java.lang")<[CacheSpan](CacheSpan.html "class in com.google.android.exoplayer2.upstream.cache")>

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 Summary

Fields | Modifier and Type | Field | Description | | --- | --- | --- | | File | file | Deprecated.

The file corresponding to this CacheSpan, or null if isCached is false. | | boolean | isCached | Deprecated.

Whether the CacheSpan is cached. | | String | key | Deprecated.

The cache key that uniquely identifies the resource. | | long | lastTouchTimestamp | Deprecated.

The last touch timestamp, or C.TIME_UNSET if isCached is false. | | long | length | Deprecated.

The length of the CacheSpan, or C.LENGTH_UNSET if this is an open-ended hole. | | long | position | Deprecated.

The position of the CacheSpan 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 hole CacheSpan. | | boolean | isOpenEnded() | Deprecated.

Returns whether this is an open-ended CacheSpan. | | String | toString() | Deprecated. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

- 

key

public final[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")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](https://developer.android.com/reference/java/io/File.html "class or interface in java.io")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](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")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](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")key,
                 long position,
                 long length,
                 long lastTouchTimestamp,
                 @Nullable[File](https://developer.android.com/reference/java/io/File.html "class or interface in java.io")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.

- 

compareTo

public int compareTo​([CacheSpan](CacheSpan.html "class in com.google.android.exoplayer2.upstream.cache")another)

Deprecated. Specified by:compareTo in interface Comparable<CacheSpan>

- 

toString

public[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")toString()

Deprecated. Overrides:toString in class Object