Class DiskLruCache.Editor

  • All Implemented Interfaces:

    
    public final class DiskLruCache.Editor
    
                        

    Edits the values for an entry.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      InputStream newInputStream(int index) Returns an unbuffered input stream to read the last committed value, or null if no value has been committed.
      String getString(int index) Returns the last committed value as a string, or null if no value has been committed.
      OutputStream newOutputStream(int index) Returns a new unbuffered output stream to write the value at index.
      void set(int index, String value) Sets the value at index to value.
      void commit() Commits this edit so it is visible to readers.
      void abort() Aborts this edit.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • newInputStream

         InputStream newInputStream(int index)

        Returns an unbuffered input stream to read the last committed value, or null if no value has been committed.

      • getString

         String getString(int index)

        Returns the last committed value as a string, or null if no value has been committed.

      • newOutputStream

         OutputStream newOutputStream(int index)

        Returns a new unbuffered output stream to write the value at index. If the underlying output stream encounters errors when writing to the filesystem, this edit will be aborted when commit is called. The returned output stream does not throw IOExceptions.

      • set

         void set(int index, String value)

        Sets the value at index to value.

      • commit

         void commit()

        Commits this edit so it is visible to readers. This releases the edit lock so another edit may be started on the same key.

      • abort

         void abort()

        Aborts this edit. This releases the edit lock so another edit may be started on the same key.