public final class DiskLruCache.Editor
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private boolean |
done |
(package private) DiskLruCache.Entry |
entry |
(package private) boolean[] |
written |
Constructor and Description |
---|
Editor(DiskLruCache.Entry entry) |
Modifier and Type | Method and Description |
---|---|
void |
abort()
Aborts this edit.
|
void |
abortUnlessCommitted() |
void |
commit()
Commits this edit so it is visible to readers.
|
(package private) void |
detach()
Prevents this editor from completing normally.
|
okio.Sink |
newSink(int index)
Returns a new unbuffered output stream to write the value at
index . |
okio.Source |
newSource(int index)
Returns an unbuffered input stream to read the last committed value, or null if no value has
been committed.
|
final DiskLruCache.Entry entry
final boolean[] written
private boolean done
Editor(DiskLruCache.Entry entry)
void detach()
public okio.Source newSource(int index)
public okio.Sink newSink(int index)
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.public void commit() throws java.io.IOException
java.io.IOException
public void abort() throws java.io.IOException
java.io.IOException
public void abortUnlessCommitted()