@Test public void returnsAStreamPositionedAtTheFirstEntry() throws Exception { try (InputStream input = navigator.getStreamAtFirstEntry()) { assertThat(navigatorsCodec.decode(input).getSeqNum(), is(equalTo(1L))); } }
@Override public InputStream getStreamAtFirstEntry() throws IOException { PersistenceReader reader = persistence.getReader(); reader.position(fileOffset); return Channels.newInputStream(reader); }
InMemoryPersistenceNavigator implements PersistenceNavigator { @Override public InputStream getStreamAtFirstEntry() throws IOException { PersistenceReader reader = persistence.getReader(); reader.position(fileOffset); return Channels.newInputStream(reader); } }
InMemoryPersistenceNavigator implements PersistenceNavigator { @Override public InputStream getStreamAtFirstEntry() throws IOException { PersistenceReader reader = persistence.getReader(); reader.position(fileOffset); return Channels.newInputStream(reader); } InMemoryPersistenceNavigator(BytePersistence persistence, SequentialEntryCodec<E> codec);  InMemoryPersistenceNavigator(BytePersistence persistence, SequentialEntryCodec<E> codec, long offset); }
InMemoryPersistenceNavigator implements PersistenceNavigator { @Override public InputStream getStreamAtFirstEntry() throws IOException { PersistenceReader reader = persistence.getReader(); reader.position(fileOffset); return Channels.newInputStream(reader); } InMemoryPersistenceNavigator(BytePersistence persistence, SequentialEntryCodec<E> codec);  InMemoryPersistenceNavigator(BytePersistence persistence, SequentialEntryCodec<E> codec, long offset); void setMaxEntrySeek(int numberOfEntries); @Override void notifyLogging(long seqNum, long byteAddress); @Override void addToIndex(long seqNum, long address); @Override void notifyTruncation(long seqNum); @Override long getAddressOfEntry(long seqNum); @Override InputStream getStreamAtSeqNum(long seqNum); @Override InputStream getStreamAtFirstEntry(); @Override InputStream getStreamAtLastEntry(); }
InMemoryPersistenceNavigator implements PersistenceNavigator { @Override public InputStream getStreamAtFirstEntry() throws IOException { PersistenceReader reader = persistence.getReader(); reader.position(fileOffset); return Channels.newInputStream(reader); } InMemoryPersistenceNavigator(BytePersistence persistence, SequentialEntryCodec<E> codec);  InMemoryPersistenceNavigator(BytePersistence persistence, SequentialEntryCodec<E> codec, long offset); void setMaxEntrySeek(int numberOfEntries); @Override void notifyLogging(long seqNum, long byteAddress); @Override void addToIndex(long seqNum, long address); @Override void notifyTruncation(long seqNum); @Override long getAddressOfEntry(long seqNum); @Override InputStream getStreamAtSeqNum(long seqNum); @Override InputStream getStreamAtFirstEntry(); @Override InputStream getStreamAtLastEntry();  }