You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support random-access ZIP input without buffering the whole archive #66
Browsing a large ZIP that is already stored in a local file currently requires buffering the entire compressed archive. OpenStream and OpenBrowser accept io.Reader and read ZIP input into a byte slice even when the original input also supports io.ReaderAt.
To reproduce, wrap a ZIP input in a reader that counts Read and ReadAt calls, then call OpenBrowser and List. The current implementation reads the entire input sequentially and never calls ReadAt.
Add an explicit constructor accepting io.ReaderAt and an archive size, allowing ZIP metadata and member bodies to be read directly from the source. Keep the existing forward-only input API available. mholt/archives uses random-access inputs and section readers for this purpose.
Preserve input-size checks, entry-count checks before allocating ZIP metadata, expanded-size limits, and cancellation. Define ownership of the underlying input and how whole-artifact hashing works if this is exposed through Reader. Conda's outer ZIP could also use this input path.
Tests should exercise the public API with a real file and an instrumented random-access reader, including malformed central directories and limits. A benchmark should compare allocations when listing a large ZIP and extracting one small member.
Source inspected: origin/main at dc26815591e2353cf40dc890953483664f882bdf. This is a library, so there is no git-pkgs --version output for it.
Activity