- All Superinterfaces:
AutoCloseable
,Closeable
- Enclosing interface:
Store
Reads an entry's metadata block and data stream.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes this viewer.long
dataSize()
Returns the size in bytes of the data stream.edit()
Returns an editor for this viewer's entry, ornull
if another edit is in progress or if the entry has been modified since this viewer was created.long
Returns the size in bytes of the metadata block and data stream.key()
Returns the entry's key.metadata()
Returns a readonly buffer containing the entry's metadata.boolean
Removes the entry associated with this viewer only if it hasn't changed since this viewer was opened.
-
Method Details
-
key
String key()Returns the entry's key. -
metadata
ByteBuffer metadata()Returns a readonly buffer containing the entry's metadata. -
newReader
Store.EntryReader newReader() -
dataSize
long dataSize()Returns the size in bytes of the data stream. -
entrySize
long entrySize()Returns the size in bytes of the metadata block and data stream. -
edit
Returns an editor for this viewer's entry, ornull
if another edit is in progress or if the entry has been modified since this viewer was created. Changes made by the returned editor are not reflected by this viewer.- Throws:
IllegalStateException
- if the store is closedIOException
InterruptedException
-
removeEntry
Removes the entry associated with this viewer only if it hasn't changed since this viewer was opened.- Throws:
IllegalStateException
- if the store is closedIOException
-
close
void close()Closes this viewer.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-