Open methods - only stream up to length #310
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The stream method under the
Open
method did not utilize the fact that we know the size of the individual compressed file and, therefore, can avoid having the stream unbounded, reducing I/O.Each entry comprises the local file header followed by the compressed file content. The size of the local header is dynamic; the base variables are 30 bytes, but then we have a dynamically sized filename and extra field. For some reason, I have to add a small buffer on top (a few bytes) to get all test cases passing.
Local file header (source Wikipedia)
Thanks to @jpambrun for catching this. Closes #308