Class DiskLruCache.Editor

java.lang.Object
org.miaixz.bus.http.cache.DiskLruCache.Editor
Enclosing class:
DiskLruCache

public final class DiskLruCache.Editor extends Object
Edits the values for an entry.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    中止这个编辑。
    void
     
    void
    Commits this edit so it is visible to readers.
    org.miaixz.bus.core.io.sink.Sink
    newSink(int index)
    Returns a new unbuffered output stream to write the value at index.
    org.miaixz.bus.core.io.source.Source
    newSource(int index)
    Returns an unbuffered input stream to read the last committed value, or null if no value has been committed.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • newSource

      public org.miaixz.bus.core.io.source.Source newSource(int index)
      Returns an unbuffered input stream to read the last committed value, or null if no value has been committed.
    • newSink

      public org.miaixz.bus.core.io.sink.Sink newSink(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.
    • commit

      public void commit() throws IOException
      Commits this edit so it is visible to readers. This releases the edit lock so another edit may be started on the same key.
      Throws:
      IOException
    • abort

      public void abort() throws IOException
      中止这个编辑。这释放了编辑锁,因此可以在同一个键上启动另一个编辑
      Throws:
      IOException - 异常
    • abortUnlessCommitted

      public void abortUnlessCommitted()