Class ParallelZipWriter

java.lang.Object
com.ljarocki.parallelzip.internal.ParallelZipWriter

public final class ParallelZipWriter extends Object
Core parallel ZIP writer. Stateless and reusable; both the directory front-end (write(java.util.List<com.ljarocki.parallelzip.internal.ParallelZipWriter.Source>, java.nio.file.Path, boolean, int, int, boolean)) and the Gradle CopyAction feed it a list of ParallelZipWriter.Entry.

Pipeline: every entry is compressed (STORE or DEFLATE) on a worker pool, while a single writer thread drains results in the given list order and streams them to the archive. Parallelism never affects the byte layout, so output is deterministic regardless of thread count. With fixed timestamps the archive is byte-for-byte reproducible across rebuilds of identical content.

Small entries are compressed in memory; entries larger than SPILL_THRESHOLD are mapped straight from the source file into the native accelerator (see MMAP_THRESHOLD) when one is available, or otherwise streamed through the JDK deflater to a temp file, so a single entry may be arbitrarily large either way. ZIP64 is emitted automatically for archives > 4 GiB, more than 65,535 entries, or per-entry sizes/offsets beyond 4 GiB.