Package org.miaixz.bus.http.cache
Class DiskLruCache.Editor
java.lang.Object
org.miaixz.bus.http.cache.DiskLruCache.Editor
- Enclosing class:
DiskLruCache
Edits the values for an entry.
-
Method Summary
Modifier and TypeMethodDescriptionvoidabort()中止这个编辑。这释放了编辑锁,因此可以在同一个键上启动另一个编辑voidvoidcommit()Commits this edit so it is visible to readers.org.miaixz.bus.core.io.sink.SinknewSink(int index) Returns a new unbuffered output stream to write the value atindex.org.miaixz.bus.core.io.source.SourcenewSource(int index) Returns an unbuffered input stream to read the last committed value, or null if no value has been committed.
-
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 atindex. If the underlying output stream encounters errors when writing to the filesystem, this edit will be aborted whencommit()is called. The returned output stream does not throw IOExceptions. -
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.- Throws:
IOException
-
abort
中止这个编辑。这释放了编辑锁,因此可以在同一个键上启动另一个编辑- Throws:
IOException- 异常
-
abortUnlessCommitted
public void abortUnlessCommitted()
-