@Test public final void testSaveEmptyDocumentToStream() throws IOException { final AnonymousOdsFileWriter writer = this.odsFactory.createWriter(); PowerMock.resetAll(); PowerMock.replayAll(); try { writer.save(this.os); } finally { this.os.close(); } PowerMock.verifyAll(); final byte[] buf = this.os.toByteArray(); final InputStream is = new ByteArrayInputStream(buf); final ZipInputStream zis = new ZipInputStream(is); ZipEntry entry = zis.getNextEntry(); final Collection<String> names = new HashSet<String>(); while (entry != null) { names.add(entry.getName()); entry = zis.getNextEntry(); } if (Math.abs(EMPTY_DOCUMENT_SIZE - buf.length) > DELTA) { System.out.println( String.format("Expected size: %d, actual size: %d", EMPTY_DOCUMENT_SIZE, buf.length)); Assert.fail(); } Assert.assertEquals( Sets.newHashSet("settings.xml", "Configurations2/images/Bitmaps/", "Configurations2/toolbar/", "META-INF/manifest.xml", "Thumbnails/", "Configurations2/floater/", "Configurations2/menubar/", "mimetype", "meta.xml", "Configurations2/accelerator/current.xml", "Configurations2/popupmenu/", "styles.xml", "content.xml", "Configurations2/progressbar/", "Configurations2/statusbar/"), names); }
public void save(final OutputStream out) throws IOException { final ZipUTF8Writer writer = ZipUTF8WriterImpl.builder().build(out); this.save(writer); writer.finish(); writer.flush(); }
AnonymousOdsFileWriter { public void save(final OutputStream out) throws IOException { final ZipUTF8Writer writer = ZipUTF8WriterImpl.builder().build(out); this.save(writer); writer.finish(); writer.flush(); } }
AnonymousOdsFileWriter { public void save(final OutputStream out) throws IOException { final ZipUTF8Writer writer = ZipUTF8WriterImpl.builder().build(out); this.save(writer); writer.finish(); writer.flush(); } AnonymousOdsFileWriter(final Logger logger, final AnonymousOdsDocument document); }
AnonymousOdsFileWriter { public void save(final OutputStream out) throws IOException { final ZipUTF8Writer writer = ZipUTF8WriterImpl.builder().build(out); this.save(writer); writer.finish(); writer.flush(); } AnonymousOdsFileWriter(final Logger logger, final AnonymousOdsDocument document); OdsDocument document(); void save(final OutputStream out); @Deprecated void save(final OutputStream out, final ZipUTF8WriterBuilderImpl builder); void save(final ZipUTF8Writer writer); void saveAs(final String filename); void saveAs(final File file); void saveAs(final String filename, final ZipUTF8WriterBuilder builder); void saveAs(final File file, final ZipUTF8WriterBuilder builder); }
AnonymousOdsFileWriter { public void save(final OutputStream out) throws IOException { final ZipUTF8Writer writer = ZipUTF8WriterImpl.builder().build(out); this.save(writer); writer.finish(); writer.flush(); } AnonymousOdsFileWriter(final Logger logger, final AnonymousOdsDocument document); OdsDocument document(); void save(final OutputStream out); @Deprecated void save(final OutputStream out, final ZipUTF8WriterBuilderImpl builder); void save(final ZipUTF8Writer writer); void saveAs(final String filename); void saveAs(final File file); void saveAs(final String filename, final ZipUTF8WriterBuilder builder); void saveAs(final File file, final ZipUTF8WriterBuilder builder);  }