-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
Add Stream-based overloads for create, verify, and extract operations to avoid loading entire files into byte[], enabling support for large files with lower memory pressure.
Problem
Current API requires byte[] for all operations. For large files (hundreds of MB or more), this causes unnecessary memory allocations and prevents streaming scenarios. The CreateAsync(Stream, ...) overload exists but internally copies to byte[].
Proposed Solution
Create
CreateAsync(Stream data, string fileName, Stream output, CancellationToken)— write the container directly to an output stream without materializing the full container in memory- Hash the input stream incrementally instead of buffering
Verify
VerifyAsync(Stream containerStream)— read and verify from a stream without loading the full container intobyte[]- Note:
ZipArchivealready accepts streams, so this is mostly API surface
Extract
ExtractAsync(Stream containerStream, Stream output)— extract data file directly to an output stream
CLI
- The CLI already works with file paths, so it benefits automatically from stream-based internals
Considerations
ZipArchiverequires a seekable stream for read mode — may need to document this limitation or buffer selectively- Hashing can be done incrementally via
IncrementalHashorCryptoStream - Backward compatible — existing
byte[]overloads remain, new stream overloads are additive
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request