Interface EntryJournal.Reader
- All Superinterfaces:
AutoCloseable
- Enclosing interface:
EntryJournal
A reader-side interface to log entries being stored in this journal.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()@Nullable EntryJournal.JournalEntryReturns the nextEntryJournal.JournalEntry, ornull.longReturns Returns thejournalIndex, guaranteed to be positive.voidresetToRead(long nextJournalIndex) Reset this reader so it attempts to read the entry at specifiedjournalIndex.
-
Method Details
-
nextJournalIndex
long nextJournalIndex()Returns Returns thejournalIndex, guaranteed to be positive.- Returns:
- Returns the
journalIndex, guaranteed to be positive
-
nextEntry
Returns the nextEntryJournal.JournalEntry, ornull.- Returns:
- the next
EntryJournal.JournalEntry, ornull - Throws:
IOException- if an I/O error occurs
-
resetToRead
Reset this reader so it attempts to read the entry at specifiedjournalIndex.- Parameters:
nextJournalIndex- the nextjournalIndexto read, must be positive- Throws:
IOException- if an I/O error occurs
-
close
void close()- Specified by:
closein interfaceAutoCloseable
-