schveiguy / iopipe

D language library for modular io
Boost Software License 1.0
77 stars 6 forks source link

unzip should handle concatenated gzip files #13

Closed schveiguy closed 6 years ago

schveiguy commented 6 years ago

Using inflate comes with a caveat, from zlib docs:

   ... Unlike the gunzip utility and gzread() (see
   below), inflate() will not automatically decode concatenated gzip streams.
   inflate() will return Z_STREAM_END at the end of the gzip stream.  The state
   would need to be reset to continue decoding a subsequent gzip stream.

unzip should handle this, probably by checking if more data exists in the input source and trying again to initialize and continue.