try {
Enumeration<LedgerEntry> entries =
ledger.readEntries(nextLedgerEntryId, nextLedgerEntryId);
currentStreamState.incrementNextLedgerEntryId();
if (entries.hasMoreElements()) {
LedgerEntry entry = entries.nextElement();
if (entries.hasMoreElements()) {
throw new IllegalStateException("More than one entry retrieved!");
}
currentStreamState.setOffsetInEntry(0);
return entry.getEntryInputStream();
}
} catch (BKException e) {
throw new IOException("Unrecoverable BookKeeper error reading entry " +
nextLedgerEntryId, e);
} catch (InterruptedException e) {