mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-09 21:24:08 +00:00
[PR #1165] (Release) Buffer size consolidation #1605
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/adamhathcock/sharpcompress/pull/1165
State: closed
Merged: Yes
This pull request standardizes and centralizes the default buffer size used for stream operations across the codebase by introducing a new
Constants.BufferSizevalue. It also simplifies method signatures for archive detection by removing thebufferSizeparameter where possible, and updates all relevant usages to reference the new constant. These changes improve consistency, maintainability, and make it easier to change the buffer size globally in the future.Buffer Size Centralization and Usage Updates:
Constants.BufferSize(default 81920 bytes) insrc/SharpCompress/Common/Constants.cs, replacing scattered magic numbers and previous constants for buffer sizes throughout the codebase.IArchiveEntryExtensions.cs,TarArchive.cs,AbstractReader.cs) to useConstants.BufferSizeinstead of hardcoded values or previous constants. [1] [2] [3] [4]API Simplification and Consistency:
bufferSizeparameter fromIsArchiveand related methods in interfaces and factories (e.g.,IFactory,Factory, and all concrete factory classes), simplifying their signatures and usage. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]IsArchive,IsZipFile, and similar methods to match the new signatures, removing the buffer size argument and ensuring consistent use ofConstants.BufferSizeinternally. [1] [2] [3] [4]Legacy Constant Cleanup:
DefaultBufferSizeconstant fromReaderOptionsand updated its usage to referenceConstants.BufferSizeinstead. [1] [2]TEMP_BUFFER_SIZEinUtility.csandBufferSizeinIArchiveEntryExtensions.cs. [1] [2]