jaime-olivares / zipstorer

A Pure C# Class to Store Files in Zip
MIT License
183 stars 63 forks source link

Added a new API that exposes a stream. #11

Closed kenkendk closed 6 years ago

kenkendk commented 7 years ago

The new method AddFile without a stream input argument returns a writeable stream, which is finalized into the archive when it is closed/disposed. The new method Extract returns a readable stream with the contents from the archive.

The previous API methods are kept compatible externally, but wraps the new stream API .

The benefits from having an external stream is that the caller can use the stream in a pipeline fashion, i.e. stream serialized data directly into the archive, instead of creating a temporary stream and passing that to ZipStorer.

This is a deeper change than what I added for #10 .

jaime-olivares commented 6 years ago

This is a big refactoring, not only what is mentioned. Please focus only on one functionality.