/** * Closes this stream, freeing all resources involved in the creation of this stream. * @throws IOException If closing fails */ @Override public void close() throws IOException { try { backingStore.close(); } finally { streamCompressor.close(); } }
/** * {@inheritDoc} * @throws Zip64RequiredException if the archive's size exceeds 4 * GByte or there are more than 65535 entries inside the archive * and {@link #setUseZip64} is {@link Zip64Mode#Never}. */ @Override public void finish() throws IOException { if (finished) { throw new IOException("This archive has already been finished"); } if (entry != null) { throw new IOException("This archive contains unclosed entries."); } cdOffset = streamCompressor.getTotalBytesWritten(); writeCentralDirectoryInChunks(); cdLength = streamCompressor.getTotalBytesWritten() - cdOffset; writeZip64CentralDirectory(); writeCentralDirectoryEnd(); metaData.clear(); entries.clear(); streamCompressor.close(); finished = true; }
/** * Closes this stream, freeing all resources involved in the creation of this stream. * @throws IOException If closing fails */ @Override public void close() throws IOException { backingStore.close(); streamCompressor.close(); }
/** * {@inheritDoc} * @throws Zip64RequiredException if the archive's size exceeds 4 * GByte or there are more than 65535 entries inside the archive * and {@link #setUseZip64} is {@link Zip64Mode#Never}. */ @Override public void finish() throws IOException { if (finished) { throw new IOException("This archive has already been finished"); } if (entry != null) { throw new IOException("This archive contains unclosed entries."); } cdOffset = streamCompressor.getTotalBytesWritten(); writeCentralDirectoryInChunks(); cdLength = streamCompressor.getTotalBytesWritten() - cdOffset; writeZip64CentralDirectory(); writeCentralDirectoryEnd(); metaData.clear(); entries.clear(); streamCompressor.close(); finished = true; }