DotNetZip - Calculate final zip size before calling Save(stream) in C#

后端 未结 2 760
情书的邮戳
情书的邮戳 2020-12-10 17:04

When using DotNetZip, is it possible to get what the final zip file size will be before calling Save(stream)? I have a application(Window Service) where package Stream size

2条回答
  •  鱼传尺愫
    2020-12-10 17:08

    not understand the answer

    The answer is quite clear, but requires some fundamental understanding of compression. Take, for example, a look at LZW.

    It comes down to this: a compression engine does not know the final size of the compressed data before compressing all the source data. And you'd rather not want to do that twice.

    As explained in the documentation of dotnetzip, the compression only starts when calling ZipFile.Save().

提交回复
热议问题