Read a ZIP you cannot seek
A fetch body or a pipe has no end to seek to, so there is no central
directory to read first. iterateZipEntries() walks the local records forward
off a ReadableStream, and the resumable inflater underneath reports exactly
how many compressed bytes it consumed. Run all three demos below.
1 ยท Forward iteration over a chunked stream
| # | Name | Method | Size | Read as |
|---|
2 ยท The resumable inflater, byte by byte
createInflator() is the only decompression tier that can suspend mid-block
and report its exact consumption โ watch bytesConsumed and
bytesProduced advance as a real deflate payload is fed in 13-byte pushes.
3 ยท The trust caveat, made visible
Without a central directory, a forward reader can only trust each local header.
This crafted archive names its entry local-name.txt locally but
trusted-name.txt in the central directory โ openZip() believes the
CD and diagnoses the mismatch; the forward reader cannot see it at all.