Class DiskLruCache.Snapshot
- java.lang.Object
-
- com.apollographql.apollo.cache.http.internal.DiskLruCache.Snapshot
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Enclosing class:
- DiskLruCache
public final class DiskLruCache.Snapshot extends java.lang.Object implements java.io.CloseableA snapshot of the values for an entry.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()DiskLruCache.Editoredit()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.longgetLength(int index)Returns the byte length of the value forindex.okio.SourcegetSource(int index)Returns the unbuffered stream with the value forindex.java.lang.Stringkey()
-
-
-
Method Detail
-
key
public java.lang.String key()
-
edit
@Nullable public DiskLruCache.Editor edit() throws java.io.IOException
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.- Throws:
java.io.IOException
-
getSource
public okio.Source getSource(int index)
Returns the unbuffered stream with the value forindex.
-
getLength
public long getLength(int index)
Returns the byte length of the value forindex.
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-