@Test public void testEmptyWithEof() throws IOException { ByteArrayOutputStream innerStream = new ByteArrayOutputStream(); try (ObjectEntryWriter writer = new ObjectEntryWriter(innerStream)) { writer.writeEof(); } try (ObjectEntryReader reader = new ObjectEntryReader(innerStream.toInputStream())) { assertThat(reader.hasNext()).isFalse(); } }
@Override public boolean hasNext() { if (!iterator.hasNext()) { throw new RuntimeException("Premature EOF"); } String nextEntry = iterator.peek(); return !EMPTY_ENTRY.equals(nextEntry); }
ObjectEntryReader implements CloseableIterator<ObjectEntry> { @Override public boolean hasNext() { if (!iterator.hasNext()) { throw new RuntimeException("Premature EOF"); } String nextEntry = iterator.peek(); return !EMPTY_ENTRY.equals(nextEntry); } }
ObjectEntryReader implements CloseableIterator<ObjectEntry> { @Override public boolean hasNext() { if (!iterator.hasNext()) { throw new RuntimeException("Premature EOF"); } String nextEntry = iterator.peek(); return !EMPTY_ENTRY.equals(nextEntry); } ObjectEntryReader(InputStream inputStream); }
ObjectEntryReader implements CloseableIterator<ObjectEntry> { @Override public boolean hasNext() { if (!iterator.hasNext()) { throw new RuntimeException("Premature EOF"); } String nextEntry = iterator.peek(); return !EMPTY_ENTRY.equals(nextEntry); } ObjectEntryReader(InputStream inputStream); @Override boolean hasNext(); @Override ObjectEntry next(); @Override void close(); }
ObjectEntryReader implements CloseableIterator<ObjectEntry> { @Override public boolean hasNext() { if (!iterator.hasNext()) { throw new RuntimeException("Premature EOF"); } String nextEntry = iterator.peek(); return !EMPTY_ENTRY.equals(nextEntry); } ObjectEntryReader(InputStream inputStream); @Override boolean hasNext(); @Override ObjectEntry next(); @Override void close();  }