java.lang.Object
org.miaixz.bus.http.cache.DiskLruCache.Snapshot
- All Implemented Interfaces:
Closeable,AutoCloseable
- Enclosing class:
DiskLruCache
A snapshot of the values for an entry.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this snapshot.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.longgetLength(int index) Returns the byte length of the value forindex.org.miaixz.bus.core.io.source.SourcegetSource(int index) Returns the unbuffered stream with the value forindex.key()Returns the key for this snapshot.
-
Method Details
-
key
Returns the key for this snapshot.- Returns:
- the key.
-
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.- Returns:
- an editor or null.
- Throws:
IOException- if an I/O error occurs.
-
getSource
public org.miaixz.bus.core.io.source.Source getSource(int index) Returns the unbuffered stream with the value forindex.- Parameters:
index- the index of the value.- Returns:
- the source for the value.
-
getLength
public long getLength(int index) Returns the byte length of the value forindex.- Parameters:
index- the index of the value.- Returns:
- the length of the value.
-
close
public void close()Closes this snapshot.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-