Class 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.Closeable
    A snapshot of the values for an entry.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 for index.
      • getLength

        public long getLength​(int index)
        Returns the byte length of the value for index.
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable