mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-04 13:34:59 +00:00
[PR #1165] [MERGED] (Release) Buffer size consolidation #1602
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?
📋 Pull Request Information
Original PR: https://github.com/adamhathcock/sharpcompress/pull/1165
Author: @adamhathcock
Created: 1/27/2026
Status: ✅ Merged
Merged: 1/27/2026
Merged by: @adamhathcock
Base:
release← Head:adam/buffer-size-consolidation📝 Commits (10+)
0a50386Using Constants class differentlyd52facdRemove change014bbc3Initial plana114155Initial plan6c86632Fix grammatical errors in ArcFactory comments53f12d7Add [Obsolete] attribute to ReaderOptions.DefaultBufferSize010a38bAdd clarifying comment about buffer size value differenced11f6aeMerge pull request #1166 from adamhathcock/copilot/sub-pr-11653c88c7fMerge pull request #1167 from adamhathcock/copilot/sub-pr-1165-againd6156f0release branch builds increment patch versions and master builds increment minor versions📊 Changes
25 files changed (+112 additions, -134 deletions)
View changed files
📝
build/Program.cs(+39 -3)📝
src/SharpCompress/Archives/ArchiveFactory.cs(+3 -11)📝
src/SharpCompress/Archives/AutoArchiveFactory.cs(+2 -5)📝
src/SharpCompress/Archives/IArchiveEntryExtensions.cs(+2 -4)📝
src/SharpCompress/Archives/Tar/TarArchive.cs(+1 -1)📝
src/SharpCompress/Archives/Zip/ZipArchive.cs(+10 -25)➕
src/SharpCompress/Common/Constants.cs(+10 -0)📝
src/SharpCompress/Factories/AceFactory.cs(+1 -5)📝
src/SharpCompress/Factories/ArcFactory.cs(+1 -5)📝
src/SharpCompress/Factories/ArjFactory.cs(+1 -5)📝
src/SharpCompress/Factories/Factory.cs(+2 -6)📝
src/SharpCompress/Factories/GZipFactory.cs(+2 -5)📝
src/SharpCompress/Factories/IFactory.cs(+1 -5)📝
src/SharpCompress/Factories/RarFactory.cs(+2 -5)📝
src/SharpCompress/Factories/SevenZipFactory.cs(+2 -5)📝
src/SharpCompress/Factories/TarFactory.cs(+2 -5)📝
src/SharpCompress/Factories/ZStandardFactory.cs(+2 -5)📝
src/SharpCompress/Factories/ZipFactory.cs(+4 -8)📝
src/SharpCompress/Readers/AbstractReader.cs(+7 -3)📝
src/SharpCompress/Readers/ReaderOptions.cs(+9 -1)...and 5 more files
📄 Description
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]🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.