Closed digitaldogsbody closed 2 years ago
@DiegoPino I sent you an invite to join the repo so we can do reviews and you can manage properly any issues etc (hope that's ok - I know you already have many spinning plates!)
This all looks good to me. Will wait for your decision on adding compression methods. But that can be a future enhancement?
This all looks good to me. Will wait for your decision on adding compression methods. But that can be a future enhancement?
Yes, I think that is for the future. Good to get this into the codebase so we can implement/test various ::getStream
methods and wrappers, as I think they will be a key part of the functionality for 1.0 release.
The main functionality of this PR is to add
::getStream
to the Seeker interface (+ an implementation forLocalFileSeeker
), and a wrapper inZipRangeReader
, plus associated tests.The interface method takes a length, an offset, and a boolean flag indicating whether or not DEFLATE compression is applied, and returns a file pointer.
The wrapper method in
ZipRangeReader
just takes a file path, and handles parsing the Local File Header (based on information from the Central Directory Record) and calculating the appropriate offset for the compressed data stream.There are a couple of additional things covered as well:
ZipRangeReader->files
array is also rekeyed to use the file name, rather than the default integer index.LocalFileSeeker
implementation that prevented retrieving data from offset 0 (i.e the first file) has been fixedCloses #1 Closes #11