Class DiskLruCache.Editor
- java.lang.Object
-
- com.apollographql.apollo.cache.http.internal.DiskLruCache.Editor
-
- Enclosing class:
- DiskLruCache
public final class DiskLruCache.Editor extends java.lang.ObjectEdits the values for an entry.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabort()Aborts this edit.voidabortUnlessCommitted()voidcommit()Commits this edit so it is visible to readers.okio.SinknewSink(int index)Returns a new unbuffered output stream to write the value atindex.okio.SourcenewSource(int index)Returns an unbuffered input stream to read the last committed value, or null if no value has been committed.
-
-
-
Method Detail
-
newSource
public okio.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 okio.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
public void commit() throws java.io.IOExceptionCommits this edit so it is visible to readers. This releases the edit lock so another edit may be started on the same key.- Throws:
java.io.IOException
-
abort
public void abort() throws java.io.IOExceptionAborts this edit. This releases the edit lock so another edit may be started on the same key.- Throws:
java.io.IOException
-
abortUnlessCommitted
public void abortUnlessCommitted()
-
-