public void writeTo(final ZipArchiveOutputStream target) throws IOException {
backingStore.closeForWriting();
final InputStream data = backingStore.getInputStream();
for (final CompressedEntry compressedEntry : items) {
final BoundedInputStream rawStream = new BoundedInputStream(data, compressedEntry.compressedSize);
target.addRawArchiveEntry(compressedEntry.transferToArchiveEntry(), rawStream);
rawStream.close();
}
data.close();
}
|