| Modifier and Type | Field and Description |
|---|---|
java.io.File |
file
|
boolean |
isCached
Whether the
CacheSpan is cached. |
java.lang.String |
key
The cache key that uniquely identifies the original stream.
|
long |
lastAccessTimestamp
The last access timestamp, or
C.TIME_UNSET if isCached is false. |
long |
length
The length of the
CacheSpan, or C.LENGTH_UNSET if this is an open-ended hole. |
long |
position
The position of the
CacheSpan in the original stream. |
| Constructor and Description |
|---|
CacheSpan(java.lang.String key,
long position,
long length)
Creates a hole CacheSpan which isn't cached, has no last access time and no file associated.
|
CacheSpan(java.lang.String key,
long position,
long length,
long lastAccessTimestamp,
java.io.File file)
Creates a CacheSpan.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(CacheSpan another) |
boolean |
isHoleSpan()
Returns whether this is a hole
CacheSpan. |
boolean |
isOpenEnded()
Returns whether this is an open-ended
CacheSpan. |
public final java.lang.String key
public final long position
CacheSpan in the original stream.public final long length
CacheSpan, or C.LENGTH_UNSET if this is an open-ended hole.public final boolean isCached
CacheSpan is cached.@Nullable public final java.io.File file
public final long lastAccessTimestamp
C.TIME_UNSET if isCached is false.public CacheSpan(java.lang.String key,
long position,
long length)
key - The cache key that uniquely identifies the original stream.position - The position of the CacheSpan in the original stream.length - The length of the CacheSpan, or C.LENGTH_UNSET if this is an
open-ended hole.public CacheSpan(java.lang.String key,
long position,
long length,
long lastAccessTimestamp,
@Nullable
java.io.File file)
key - The cache key that uniquely identifies the original stream.position - The position of the CacheSpan in the original stream.length - The length of the CacheSpan, or C.LENGTH_UNSET if this is an
open-ended hole.lastAccessTimestamp - The last access timestamp, or C.TIME_UNSET if isCached is false.file - The file corresponding to this CacheSpan, or null if it's a hole.