public final class DiskLruCache.Snapshot
extends java.lang.Object
implements java.io.Closeable
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
key |
private long[] |
lengths |
private long |
sequenceNumber |
private okio.Source[] |
sources |
Constructor and Description |
---|
Snapshot(java.lang.String key,
long sequenceNumber,
okio.Source[] sources,
long[] lengths) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
DiskLruCache.Editor |
edit()
Returns an editor for this snapshot's entry, or null if either the entry has changed since
this snapshot was created or if another edit is in progress.
|
long |
getLength(int index)
Returns the byte length of the value for
index . |
okio.Source |
getSource(int index)
Returns the unbuffered stream with the value for
index . |
java.lang.String |
key() |
private final java.lang.String key
private final long sequenceNumber
private final okio.Source[] sources
private final long[] lengths
Snapshot(java.lang.String key, long sequenceNumber, okio.Source[] sources, long[] lengths)
public java.lang.String key()
@Nullable public DiskLruCache.Editor edit() throws java.io.IOException
java.io.IOException
public okio.Source getSource(int index)
index
.public long getLength(int index)
index
.public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable