-
public final class DiskLruCache.EditorEdits the values for an entry.
-
-
Method Summary
Modifier and Type Method Description InputStreamnewInputStream(int index)Returns an unbuffered input stream to read the last committed value,or null if no value has been committed. StringgetString(int index)Returns the last committed value as a string, or null if no value hasbeen committed. OutputStreamnewOutputStream(int index)Returns a new unbuffered output stream to write the value at {@code index}.voidset(int index, String value)Sets the value at {@code index}to{@code value}.voidcommit()Commits this edit so it is visible to readers. voidabort()Aborts this edit. voidabortUnlessCommitted()-
-
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 hasbeen committed.
-
newOutputStream
OutputStream newOutputStream(int index)
Returns a new unbuffered output stream to write the value at
{@code index}. If the underlying output stream encounters errors whenwriting to the filesystem, this edit will be aborted when commit is called. The returned output stream does not throwIOExceptions.
-
commit
void commit()
Commits this edit so it is visible to readers. This releases the editlock 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 bestarted on the same key.
-
abortUnlessCommitted
void abortUnlessCommitted()
-
-
-
-