-
- All Implemented Interfaces:
-
java.io.Closeable,java.lang.AutoCloseable
public class ScatterZipOutputStream implements Closeable
A zip output stream that is optimized for multi-threaded scatter/gather construction of zip files.
The internal data format of the entries used by this class are entirely private to this class and are not part of any public api whatsoever.
It is possible to extend this class to support different kinds of backing storage, the default implementation only supports file-based backing.
Thread safety: This class supports multiple threads. But the "writeTo" method must be called by the thread that originally created the ZipArchiveEntry.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classScatterZipOutputStream.ZipEntryWriter
-
Constructor Summary
Constructors Constructor Description ScatterZipOutputStream(ScatterGatherBackingStore backingStore, StreamCompressor streamCompressor)
-
Method Summary
Modifier and Type Method Description voidaddArchiveEntry(ZipArchiveEntryRequest zipArchiveEntryRequest)Add an archive entry to this scatter stream. voidclose()Closes this stream, freeing all resources involved in the creation of this stream. voidwriteTo(ZipArchiveOutputStream target)Write the contents of this scatter stream to a target archive. ScatterZipOutputStream.ZipEntryWriterzipEntryWriter()Get a zip entry writer for this scatter stream. -
-
Constructor Detail
-
ScatterZipOutputStream
ScatterZipOutputStream(ScatterGatherBackingStore backingStore, StreamCompressor streamCompressor)
-
-
Method Detail
-
addArchiveEntry
void addArchiveEntry(ZipArchiveEntryRequest zipArchiveEntryRequest)
Add an archive entry to this scatter stream.
- Parameters:
zipArchiveEntryRequest- The entry to write.
-
close
void close()
Closes this stream, freeing all resources involved in the creation of this stream.
-
writeTo
void writeTo(ZipArchiveOutputStream target)
Write the contents of this scatter stream to a target archive.
- Parameters:
target- The archive to receive the contents of this ScatterZipOutputStream.
-
zipEntryWriter
ScatterZipOutputStream.ZipEntryWriter zipEntryWriter()
Get a zip entry writer for this scatter stream.
-
-
-
-