@Test public void testEmptyWithEof() throws IOException { ByteArrayOutputStream innerStream = new ByteArrayOutputStream(); try(ObjectEntryWriter writer = new ObjectEntryWriter(innerStream)) { writer.writeEof(); } assertThat(innerStream.toInputStream()).hasContent("{}"); }
public void writeEof() throws IOException { ensureNotClosed(); ensureNotEof(); if (!isEmpty) { writer.append("\n"); } isEmpty = false; writer.write(EMPTY_ENTRY); isEofWritten = true; }
ObjectEntryWriter implements AutoCloseable { public void writeEof() throws IOException { ensureNotClosed(); ensureNotEof(); if (!isEmpty) { writer.append("\n"); } isEmpty = false; writer.write(EMPTY_ENTRY); isEofWritten = true; } }
ObjectEntryWriter implements AutoCloseable { public void writeEof() throws IOException { ensureNotClosed(); ensureNotEof(); if (!isEmpty) { writer.append("\n"); } isEmpty = false; writer.write(EMPTY_ENTRY); isEofWritten = true; } ObjectEntryWriter(OutputStream ouputStream); }
ObjectEntryWriter implements AutoCloseable { public void writeEof() throws IOException { ensureNotClosed(); ensureNotEof(); if (!isEmpty) { writer.append("\n"); } isEmpty = false; writer.write(EMPTY_ENTRY); isEofWritten = true; } ObjectEntryWriter(OutputStream ouputStream); void write(ObjectEntry objectEntry); void writeEof(); @Override void close(); }
ObjectEntryWriter implements AutoCloseable { public void writeEof() throws IOException { ensureNotClosed(); ensureNotEof(); if (!isEmpty) { writer.append("\n"); } isEmpty = false; writer.write(EMPTY_ENTRY); isEofWritten = true; } ObjectEntryWriter(OutputStream ouputStream); void write(ObjectEntry objectEntry); void writeEof(); @Override void close();  }