-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove BinaryReader and BinaryWriter references from ZipArchive #103153
Open
edwardneal
wants to merge
10
commits into
dotnet:main
Choose a base branch
from
edwardneal:ziparchive-stream-read-write
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Commits on Jun 4, 2024
-
Removed BinaryReader, BinaryWriter from ZipArchive and ZipBlocks
We now read the data into a (sometimes stack-allocated) byte array and slice it up with BinaryPrimitives. This reduces the number of reads and writes required to read and write a ZipArchive. It also makes future work to enable async APIs easier, since BinaryReader and BinaryWriter lack this support. Also changed approach to reading central file directory headers. Rather than performing X reads per header, we read 4KB of data at a time and look for all applicable headers in that data. This should improve performance when dealing with many small files.
Configuration menu - View commit details
-
Copy full SHA for 989e929 - Browse repository at this point
Copy the full SHA 989e929View commit details -
Removed BinaryReader from ZipArchiveEntry
This allowed the removal of the ArchiveReader property from ZipArchive.
Configuration menu - View commit details
-
Copy full SHA for 13dee7a - Browse repository at this point
Copy the full SHA 13dee7aView commit details
Commits on Jun 5, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 650b4f8 - Browse repository at this point
Copy the full SHA 650b4f8View commit details -
Configuration menu - View commit details
-
Copy full SHA for b0b8f25 - Browse repository at this point
Copy the full SHA b0b8f25View commit details
Commits on Jun 7, 2024
-
Reduced memory usage with array pooling
Now pooling the file IO buffers and the temporary buffers for extra fields of the CD file header (which would otherwise be allocated and deallocated in a loop.)
Configuration menu - View commit details
-
Copy full SHA for 8d1c807 - Browse repository at this point
Copy the full SHA 8d1c807View commit details -
Configuration menu - View commit details
-
Copy full SHA for c56ff3a - Browse repository at this point
Copy the full SHA c56ff3aView commit details -
Added test for changed central directory read method
This handles 64x entries with 19-character filenames (and thus, 65-byte file headers.) As a result, it straddles two 4KB read buffers. Also corrected the seek logic while reading the central directory header
Configuration menu - View commit details
-
Copy full SHA for 9691c2a - Browse repository at this point
Copy the full SHA 9691c2aView commit details
Commits on Aug 8, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 444b85e - Browse repository at this point
Copy the full SHA 444b85eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 13fc2e8 - Browse repository at this point
Copy the full SHA 13fc2e8View commit details
Commits on Aug 9, 2024
-
The buffer returned from the ArrayPool contained older data (including a ZIP header.) When reading the last chunk of the file (i.e a chunk which was less than BackwardsSeekingBufferSize) the buffer's Span wasn't resized to account for this. SeekBackwardsToSignature would thus find the older data, try to seek beyond the end of the stream and fail to read the file.
Configuration menu - View commit details
-
Copy full SHA for 27c5aaf - Browse repository at this point
Copy the full SHA 27c5aafView commit details
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.