Add ability to have alternate compressions - #1197
Conversation
…compressions # Conflicts: # src/SharpCompress/Archives/GZip/GZipArchive.Async.cs # src/SharpCompress/Archives/GZip/GZipArchive.cs # src/SharpCompress/Archives/Zip/ZipArchive.Async.cs # src/SharpCompress/Archives/Zip/ZipArchive.cs # src/SharpCompress/Common/GZip/GZipEntry.Async.cs # src/SharpCompress/Common/GZip/GZipEntry.cs # src/SharpCompress/Common/Options/IReaderOptions.cs # src/SharpCompress/Readers/ReaderOptions.cs # src/SharpCompress/Readers/Zip/ZipReader.Async.cs # src/SharpCompress/Readers/Zip/ZipReader.cs # src/SharpCompress/Writers/GZip/GZipWriterOptions.cs
| ); | ||
| internal override Stream GetCompressedStream() | ||
| { | ||
| return _compressionProviders.CreateDecompressStream(CompressionType.Deflate, _stream); |
There was a problem hiding this comment.
WARNING: GZip uses Deflate compression, but this hardcodes CompressionType.Deflate instead of using CompressionType.GZip.
When a custom provider is registered for GZip, this code will still use the Deflate provider for decompression. This breaks the provider abstraction for GZip files.
Consider using CompressionType.GZip here, or ensure the provider registry properly maps GZip to use the correct decompression implementation.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (84 files)
|
There was a problem hiding this comment.
Pull request overview
Adds a configurable CompressionProviderRegistry that flows through SharpCompress reader/writer options so callers can swap compression stream implementations (e.g., use System.IO.Compression for GZip/Deflate) while keeping internal defaults.
Changes:
- Introduces
ICompressionProvider,CompressionProviderRegistry, andCompressionContext(plus hook/finalization interfaces) and internal default provider implementations for manyCompressionTypes. - Threads
ProvidersthroughReaderOptions/WriterOptions(and format-specific options) into ZIP/GZip/Tar read/write pipelines. - Adds docs + tests demonstrating replacing providers and validating round-trips / compatibility.
Reviewed changes
Copilot reviewed 55 out of 55 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/SharpCompress.Test/CompressionProviderTests.cs | New unit tests covering default registry, replacement, cloning, and System.IO.Compression provider scenarios. |
| src/SharpCompress/Writers/Zip/ZipWriterOptions.cs | Adds Providers to zip writer options and copies it from generic options. |
| src/SharpCompress/Writers/Zip/ZipWriter.cs | Uses provider registry for ZIP compression streams; introduces hook-based init for LZMA/PPMd. |
| src/SharpCompress/Writers/WriterOptionsExtensions.cs | Adds WithProviders(...) helper for WriterOptions. |
| src/SharpCompress/Writers/WriterOptions.cs | Adds Providers to generic writer options (defaulting to CompressionProviderRegistry.Default). |
| src/SharpCompress/Writers/Tar/TarWriterOptions.cs | Adds Providers and copies from generic options. |
| src/SharpCompress/Writers/Tar/TarWriter.cs | Uses provider registry to create compression stream; finalizes via IFinishable. |
| src/SharpCompress/Writers/GZip/GZipWriterOptions.cs | Adds Providers and copies from generic options. |
| src/SharpCompress/Writers/GZip/GZipWriter.cs | Creates gzip compression stream via provider registry instead of hard-coded internal stream construction. |
| src/SharpCompress/Readers/Zip/ZipReader.cs | Passes Options.Providers into ZIP file parts for decompression. |
| src/SharpCompress/Readers/Zip/ZipReader.Async.cs | Passes _options.Providers into streaming ZIP file parts for decompression. |
| src/SharpCompress/Readers/Tar/TarReader.cs | Uses provider registry for tar wrapper decompression stream creation. |
| src/SharpCompress/Readers/ReaderOptionsExtensions.cs | Adds WithProviders(...) helper for ReaderOptions. |
| src/SharpCompress/Readers/ReaderOptions.cs | Adds Providers to reader options (defaulting to CompressionProviderRegistry.Default). |
| src/SharpCompress/Compressors/Providers/ZStandardCompressionProvider.cs | Internal ZStandard provider implementation. |
| src/SharpCompress/Compressors/Providers/XzCompressionProvider.cs | Internal XZ provider (decompress-only). |
| src/SharpCompress/Compressors/Providers/SystemGZipCompressionProvider.cs | System.IO.Compression-based GZip provider. |
| src/SharpCompress/Compressors/Providers/SystemDeflateCompressionProvider.cs | System.IO.Compression-based Deflate provider. |
| src/SharpCompress/Compressors/Providers/ShrinkCompressionProvider.cs | Internal Shrink provider (decompress-only, context sizes required). |
| src/SharpCompress/Compressors/Providers/Reduce4CompressionProvider.cs | Internal Reduce4 provider (decompress-only, context sizes required). |
| src/SharpCompress/Compressors/Providers/Reduce3CompressionProvider.cs | Internal Reduce3 provider (decompress-only, context sizes required). |
| src/SharpCompress/Compressors/Providers/Reduce2CompressionProvider.cs | Internal Reduce2 provider (decompress-only, context sizes required). |
| src/SharpCompress/Compressors/Providers/Reduce1CompressionProvider.cs | Internal Reduce1 provider (decompress-only, context sizes required). |
| src/SharpCompress/Compressors/Providers/PpmdCompressingProvider.cs | Internal PPMd provider implementing ICompressionProviderHooks. |
| src/SharpCompress/Compressors/Providers/LzwCompressionProvider.cs | Internal LZW provider (decompress-only). |
| src/SharpCompress/Compressors/Providers/LzmaCompressingProvider.cs | Internal LZMA provider implementing ICompressionProviderHooks. |
| src/SharpCompress/Compressors/Providers/LZipCompressionProvider.cs | Internal LZip provider. |
| src/SharpCompress/Compressors/Providers/GZipCompressionProvider.cs | Internal GZip provider. |
| src/SharpCompress/Compressors/Providers/ExplodeCompressionProvider.cs | Internal Explode provider (decompress-only, context required). |
| src/SharpCompress/Compressors/Providers/DeflateCompressionProvider.cs | Internal Deflate provider. |
| src/SharpCompress/Compressors/Providers/Deflate64CompressionProvider.cs | Internal Deflate64 provider (decompress-only). |
| src/SharpCompress/Compressors/Providers/BZip2CompressionProvider.cs | Internal BZip2 provider. |
| src/SharpCompress/Compressors/LZMA/LZipStream.cs | Implements IFinishable for generic finalization. |
| src/SharpCompress/Compressors/IFinishable.cs | New interface for streams needing explicit finalization. |
| src/SharpCompress/Compressors/ICompressionProviderHooks.cs | Hook interface for pre/properties/post data patterns (e.g., LZMA/PPMd in Zip). |
| src/SharpCompress/Compressors/ICompressionProvider.cs | New provider abstraction for compress/decompress stream creation. |
| src/SharpCompress/Compressors/CompressionProviderRegistry.cs | New immutable registry with default internal providers and helper methods. |
| src/SharpCompress/Compressors/CompressionContext.cs | New context record carrying sizes/properties/format options for providers. |
| src/SharpCompress/Compressors/BZip2/BZip2Stream.cs | Implements IFinishable for generic finalization. |
| src/SharpCompress/Common/Zip/ZipFilePart.cs | Uses provider registry + CompressionContext for ZIP entry decompression. |
| src/SharpCompress/Common/Zip/StreamingZipFilePart.cs | Accepts provider registry and passes through to base ZIP part. |
| src/SharpCompress/Common/Zip/SeekableZipFilePart.cs | Accepts provider registry and passes through to base ZIP part. |
| src/SharpCompress/Common/Options/IWriterOptions.cs | Adds Providers to writer options interface. |
| src/SharpCompress/Common/Options/IReaderOptions.cs | Adds Providers to reader options interface. |
| src/SharpCompress/Common/GZip/GZipFilePart.cs | Accepts provider registry for gzip payload decompression stream creation. |
| src/SharpCompress/Common/GZip/GZipFilePart.Async.cs | Async create path accepts provider registry. |
| src/SharpCompress/Common/GZip/GZipEntry.cs | Threads options.Providers into GZipFilePart.Create. |
| src/SharpCompress/Common/GZip/GZipEntry.Async.cs | Threads options.Providers into GZipFilePart.CreateAsync. |
| src/SharpCompress/Archives/Zip/ZipArchive.cs | Passes ReaderOptions.Providers into seekable ZIP parts. |
| src/SharpCompress/Archives/Zip/ZipArchive.Async.cs | Passes ReaderOptions.Providers into seekable ZIP parts (async). |
| src/SharpCompress/Archives/GZip/GZipArchive.cs | Passes ReaderOptions.Providers into GZipFilePart.Create. |
| src/SharpCompress/Archives/GZip/GZipArchive.Async.cs | Passes ReaderOptions.Providers into GZipFilePart.CreateAsync. |
| docs/USAGE.md | Adds usage guide for custom compression providers. |
| docs/API.md | Documents Providers registry and hook contract. |
| README.md | Adds a high-level overview and links for custom compression providers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Get the compression type and providers | ||
| var compressionType = ToCompressionType(method); | ||
| var providers = GetProviders(); | ||
|
|
||
| // Build context with header information | ||
| var context = new CompressionContext | ||
| { | ||
| InputSize = Header.CompressedSize, | ||
| OutputSize = Header.UncompressedSize, | ||
| CanSeek = stream.CanSeek, |
There was a problem hiding this comment.
ZipFilePart.cs still imports a number of compressor implementation namespaces (BZip2/Deflate/Deflate64/Explode/LZMA/PPMd/Reduce/Shrink/Xz/ZStandard), but the refactored implementation now resolves decompression via CompressionProviderRegistry and no longer references those types. With TreatWarningsAsErrors enabled, the resulting CS8019 warnings will fail the build; remove the unused using directives.
| using SharpCompress.Common.Zip; | ||
| using SharpCompress.Common.Zip.Headers; | ||
| using SharpCompress.Compressors; | ||
|
|
There was a problem hiding this comment.
ZipReader.Async.cs adds using SharpCompress.Compressors;, but this file doesn’t reference any types from that namespace (it only accesses _options.Providers). With TreatWarningsAsErrors enabled, this will trigger CS8019 and fail the build; remove the unused using directive.
| @@ -0,0 +1,44 @@ | |||
| using System; | |||
There was a problem hiding this comment.
CompressionContext.cs includes using System; which is unused in this file. With TreatWarningsAsErrors enabled, this will fail the build (CS8019). Remove the unused using directive.
| using System; |
| // Use the configured compression providers | ||
| var providers = WriterOptions.Providers; | ||
|
|
||
| // Create the GZip stream using the provider | ||
| var compressionStream = providers.CreateCompressStream( | ||
| CompressionType.GZip, | ||
| destination, | ||
| WriterOptions.CompressionLevel | ||
| ); |
There was a problem hiding this comment.
GZipWriter used to pass WriterOptions.ArchiveEncoding.GetEncoding() into the internal SharpCompress.Compressors.Deflate.GZipStream constructor. With the new provider-based creation, internal gzip streams will always use the default UTF-8 encoding, changing the bytes written for the header filename/comment when a non-default ArchiveEncoding is configured. Consider using the provider overload that accepts a CompressionContext (e.g., pass the encoding via context.FormatOptions or a dedicated field) and update GZipCompressionProvider to honor it by calling the 4-arg GZipStream constructor.
| internal override Stream GetCompressedStream() | ||
| { | ||
| //GZip uses Deflate compression, at this point we need a deflate stream | ||
| return _compressionProviders.CreateDecompressStream(CompressionType.Deflate, _stream); |
There was a problem hiding this comment.
GZipFilePart.GetCompressedStream() always resolves CompressionType.Deflate from the provider registry. That means swapping the CompressionType.GZip provider (e.g., to SystemGZipCompressionProvider) will not affect reading .gz archives via GZipArchive/GZipEntry; only replacing the Deflate provider would. If the intent is that .gz reading honors the GZip provider, this needs a different integration point (or the docs should explicitly note that .gz uses the Deflate provider).
| var providers = writer.WriterOptions.Providers; | ||
|
|
||
| switch (zipCompressionMethod) | ||
| { |
There was a problem hiding this comment.
After refactoring to provider-based compression, ZipWriter.cs no longer references several compression-implementation types directly, but the corresponding using SharpCompress.Compressors.* directives at the top of the file remain. With warnings treated as errors, the resulting “unnecessary using directive” warnings (CS8019) will fail the build; remove any now-unused compressor usings (e.g., BZip2/Deflate/LZMA/ZStandard) and keep only the ones still needed (like PPMd if referenced).
| // Use ICompressionProviderHooks for complex initialization | ||
| var compressingProvider = providers.GetCompressingProvider( | ||
| CompressionType.LZMA | ||
| ); | ||
| counting.Write(lzmaStream.Properties, 0, lzmaStream.Properties.Length); | ||
| if (compressingProvider is null) | ||
| { | ||
| throw new InvalidOperationException("LZMA compression provider not found."); | ||
| } | ||
|
|
||
| var context = new CompressionContext { CanSeek = originalStream.CanSeek }; | ||
|
|
||
| // Write pre-compression data (magic bytes) | ||
| var preData = compressingProvider.GetPreCompressionData(context); | ||
| if (preData != null) | ||
| { | ||
| counting.Write(preData, 0, preData.Length); | ||
| } | ||
|
|
||
| // Create compression stream | ||
| var lzmaStream = compressingProvider.CreateCompressStream( | ||
| counting, | ||
| compressionLevel, | ||
| context | ||
| ); | ||
|
|
||
| // Write compression properties | ||
| var props = compressingProvider.GetCompressionProperties(lzmaStream, context); | ||
| if (props != null) | ||
| { | ||
| counting.Write(props, 0, props.Length); | ||
| } | ||
|
|
||
| return lzmaStream; | ||
| } | ||
| case ZipCompressionMethod.PPMd: | ||
| { | ||
| counting.Write(writer.PpmdProperties.Properties, 0, 2); | ||
| return PpmdStream.Create(writer.PpmdProperties, counting, true); | ||
| // Use ICompressionProviderHooks for complex initialization | ||
| var compressingProvider = providers.GetCompressingProvider( | ||
| CompressionType.PPMd | ||
| ); | ||
| if (compressingProvider is null) | ||
| { | ||
| throw new InvalidOperationException("PPMd compression provider not found."); | ||
| } | ||
|
|
||
| var context = new CompressionContext | ||
| { | ||
| CanSeek = originalStream.CanSeek, | ||
| FormatOptions = writer.PpmdProperties, | ||
| }; | ||
|
|
||
| // Write pre-compression data (properties) | ||
| var preData = compressingProvider.GetPreCompressionData(context); | ||
| if (preData != null) | ||
| { | ||
| counting.Write(preData, 0, preData.Length); | ||
| } | ||
|
|
||
| // Create compression stream | ||
| return compressingProvider.CreateCompressStream( | ||
| counting, | ||
| compressionLevel, | ||
| context | ||
| ); |
There was a problem hiding this comment.
ZipWriter uses ICompressionProviderHooks for pre-stream bytes and properties, but never calls GetPostCompressionData(...). That makes it impossible for a custom provider to append required footer bytes after the compression stream completes, and also risks incorrect entry.Compressed sizing when such footers are needed. Consider capturing the selected hooks-provider + context and, in ZipWritingStream.Dispose, after disposing the compression stream but before reading counting.BytesWritten, write any post-compression bytes returned by the provider.
| ); | ||
|
|
||
| // If using internal GZipStream, set the encoding for header filename | ||
| if (compressionStream is GZipStream gzipStream) |
There was a problem hiding this comment.
This assignment to gzipStream is useless, since its value is never read.
| { | ||
| var original = CompressionProviderRegistry.Default; | ||
| var customProvider = new DeflateCompressionProvider(); | ||
| var modified = original.With(customProvider); |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 61 out of 61 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| public Stream CreateCompressStream(Stream destination, int compressionLevel) | ||
| { | ||
| var level = (CompressionLevel)compressionLevel; | ||
| return new GZipStream(destination, CompressionMode.Compress, level); | ||
| } | ||
|
|
||
| public Stream CreateCompressStream( | ||
| Stream destination, | ||
| int compressionLevel, | ||
| CompressionContext context | ||
| ) | ||
| { | ||
| // Context not used for simple GZip compression | ||
| return CreateCompressStream(destination, compressionLevel); | ||
| } |
There was a problem hiding this comment.
The internal GZipCompressionProvider always constructs SharpCompress.Compressors.Deflate.GZipStream with its default encoding (UTF-8). Since GZipWriter previously used WriterOptions.ArchiveEncoding, the provider should accept/consume encoding from CompressionContext (or similar) so callers can preserve non-UTF8 header encoding when needed.
| FlagUtility.HasFlag(Header.Flags, HeaderFlags.UsePostDataDescriptor) || Header.IsZip64; | ||
|
|
||
| /// <summary> | ||
| /// Gets the compression provider registry, falling back to default if not set. |
There was a problem hiding this comment.
The doc comment says GetProviders() “falls back to default if not set”, but _compressionProviders is required by the constructor and the method just returns the field. Either implement an actual fallback (e.g., null/optional ctor param) or adjust the comment to match behavior.
| /// Gets the compression provider registry, falling back to default if not set. | |
| /// Gets the configured compression provider registry. |
| foreach (var entry in archive.Entries.Where(e => !e.IsDirectory)) | ||
| { | ||
| using var entryStream = entry.OpenEntryStream(); | ||
| entryStream.CopyTo(Stream.Null); | ||
| } |
There was a problem hiding this comment.
This foreach loop immediately maps its iteration variable to another variable - consider mapping the sequence explicitly using '.Select(...)'.
| foreach (var entry in archive.Entries.Where(e => !e.IsDirectory)) | ||
| { | ||
| using var entryStream = entry.OpenEntryStream(); | ||
| entryStream.CopyTo(Stream.Null); | ||
| } |
There was a problem hiding this comment.
This foreach loop immediately maps its iteration variable to another variable - consider mapping the sequence explicitly using '.Select(...)'.
c4fb32a to
5fe248e
Compare
5fe248e to
c4fb32a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 61 out of 61 changed files in this pull request and generated 8 comments.
Comments suppressed due to low confidence (1)
tests/SharpCompress.Test/ReaderTests.cs:117
- Second
IsArchiveAsynccall also opens a newFileStreamwithout disposing it. Please ensure the stream is disposed (and ideally avoid opening the file twice).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
# Conflicts: # tests/SharpCompress.Performance/Benchmarks/TarBenchmarks.cs # tests/SharpCompress.Performance/Benchmarks/ZipBenchmarks.cs # tests/SharpCompress.Performance/baseline-results.md
Updated [SharpCompress](https://github.com/adamhathcock/sharpcompress) from 0.29.0 to 0.48.0. <details> <summary>Release notes</summary> _Sourced from [SharpCompress's releases](https://github.com/adamhathcock/sharpcompress/releases)._ ## 0.48.0 Getting some fixes out to prep for bigger release - async writing might still not work on non-async streams ## What's Changed * Fix SevenZipArchive.IsSolidAsync() always returning false by @Copilot in adamhathcock/sharpcompress#1284 * Fix sync methods called in async RAR unpacker paths (Unpack29Async, U… by @adamhathcock in adamhathcock/sharpcompress#1306 * adamhathcock/sharpcompress#1313 **Full Changelog**: adamhathcock/sharpcompress@0.47.4...0.48.0 ## 0.47.4 ## What's Changed * Dynamic ring buffer sizing for BZip2 and ZStandard on non-seekable streams by @Copilot in adamhathcock/sharpcompress#1273 * Fix fuzzer-found decompression bomb and crash bugs by @Copilot in adamhathcock/sharpcompress#1272 **Full Changelog**: adamhathcock/sharpcompress@0.47.3...0.47.4 ## 0.47.3 ## What's Changed * Fix denial-of-service crashes in 8 decompressors on malformed input by @Copilot in adamhathcock/sharpcompress#1260 **Full Changelog**: adamhathcock/sharpcompress@0.47.2...0.47.3 ## 0.47.2 Making the default experience better with a larger buffer size. ## What's Changed * Increase default RewindableBufferSize to 160KB to handle ZStandard tar detection by @Copilot in adamhathcock/sharpcompress#1257 **Full Changelog**: adamhathcock/sharpcompress@0.47.1...0.47.2 ## 0.47.1 ## What's Changed * Proper test file clean up by @adamhathcock in adamhathcock/sharpcompress#1245 * Fix ZIP64 stream bounding and WinZip AES read-state corruption in ZIP reader by @adamhathcock in adamhathcock/sharpcompress#1253 **Full Changelog**: adamhathcock/sharpcompress@0.47.0...0.47.1 ## 0.47.0 I think this is the last breaking change before I mark things as 1.0. Looking for feedback ## What's Changed * Fix CompressionType for WinZip AES encrypted ZIP entries by @Copilot in adamhathcock/sharpcompress#1213 * Add ability to have alternate compressions by @adamhathcock in adamhathcock/sharpcompress#1197 * Expose SharpCompressStream to allow ringbuffer to be used on non-seekable streams by @adamhathcock in adamhathcock/sharpcompress#1220 * Tightening build errors by warnings as errors and making more build time issues by @adamhathcock in adamhathcock/sharpcompress#1214 * Use more SharpCompress exceptions instead of generic ones by @adamhathcock in adamhathcock/sharpcompress#1224 * Added Net7.0 / Net 6.0 / Net 5.0 and NetStandard2.1 by @Nanook in adamhathcock/sharpcompress#1227 * Writers should have async API by @adamhathcock in adamhathcock/sharpcompress#1211 * Add 7z archive writer with LZMA/LZMA2 compression by @DanNsk in adamhathcock/sharpcompress#1229 * Add async 7z writing by @adamhathcock in adamhathcock/sharpcompress#1235 * Bump actions/upload-artifact from 6 to 7 by @dependabot[bot] in adamhathcock/sharpcompress#1240 * Moving extraction options back by @adamhathcock in adamhathcock/sharpcompress#1239 * Fix DataErrorException when extracting LZMA-compressed zero-byte ZIP entries by @Copilot in adamhathcock/sharpcompress#1237 * Update test dependencies by @adamhathcock in adamhathcock/sharpcompress#1242 ## New Contributors * @DanNsk made their first contribution in adamhathcock/sharpcompress#1229 **Full Changelog**: adamhathcock/sharpcompress@0.46.4...0.47.0 ## 0.46.4 ## What's Changed * Fix DataErrorException when extracting LZMA-compressed zero-byte ZIP entries by @adamhathcock in adamhathcock/sharpcompress#1238 **Full Changelog**: adamhathcock/sharpcompress@0.46.3...0.46.4 ## 0.46.3 ## What's Changed * Fix SharpCompressStream.Create() buffer size misalignment for non-seekable streams by @Copilot in adamhathcock/sharpcompress#1234 * Make SharpCompressStream public by @adamhathcock in adamhathcock/sharpcompress#1233 **Full Changelog**: adamhathcock/sharpcompress@0.46.2...0.46.3 ## 0.46.2 ## What's Changed * Downgrade dependencies for legacy frameworks by @adamhathcock in adamhathcock/sharpcompress#1226 **Full Changelog**: adamhathcock/sharpcompress@0.46.1...0.46.2 ## 0.46.1 ## What's Changed * Fix NullReferenceException when extracting 7z empty-stream entries by @Copilot in adamhathcock/sharpcompress#1219 **Full Changelog**: adamhathcock/sharpcompress@0.46.0...0.46.1 ## 0.46.0 Open/Create must be asynchronous now so they return ValueTasks when they didn't before. ## What's Changed * RAR5 (and maybe others) async methods are different by @adamhathcock in adamhathcock/sharpcompress#1203 * update benchmarks to include async paths by @adamhathcock in adamhathcock/sharpcompress#1202 * OpenAsyncReader, OpenAsyncArchive and others must be async for Tar detection by @adamhathcock in adamhathcock/sharpcompress#1210 **Full Changelog**: adamhathcock/sharpcompress@0.45.1...0.46.0 ## 0.45.1 The big regression was fixed in 0.44.5 and 0.45.0 but only for sync. This does it for async too. ## What's Changed * fix async 7z seeking by @adamhathcock in adamhathcock/sharpcompress#1200 **Full Changelog**: adamhathcock/sharpcompress@0.45.0...0.45.1 ## 0.45.0 This release should be fully async as well as sync depending on the API used. I've endeavoured to make sure no sync methods are used when going via the async interface (and vice versa) but you never know. Tests should cover things as well as the recent fixes (like the 7z regression) Options and the API have been revamped so expect API breakages. I think it should be straight-forward but things won't compile. There is a thing about Dispose vs async Disposing that may or may not be fully covered 😬 Feedback is welcome as I think 1.0 is around the corner with the introduction of Providers and other things. I wanted to get the async revamp out generally first though. ## What's Changed * Consolidate stream extension methods and simplify with framework methods by @Copilot in adamhathcock/sharpcompress#1100 * Change ArchiveEncoding to interface. by @adamhathcock in adamhathcock/sharpcompress#1117 * Readd netstandard 2.0 by @adamhathcock in adamhathcock/sharpcompress#1122 * Add more documentation by @adamhathcock in adamhathcock/sharpcompress#1123 * Fix async test method naming inconsistency in ZipArchiveAsyncTests by @Copilot in adamhathcock/sharpcompress#1124 * [WIP] Update ZipReader and ZipWriter based on review feedback by @Copilot in adamhathcock/sharpcompress#1125 * Fix typo in TestBase.cs comment by @Copilot in adamhathcock/sharpcompress#1126 * Fix async test method naming in ZipArchiveAsyncTests by @Copilot in adamhathcock/sharpcompress#1127 * More async for ZipReader and ZipWriter by @adamhathcock in adamhathcock/sharpcompress#1121 * Add ArcReaderAsync tests by @adamhathcock in adamhathcock/sharpcompress#1036 * Change interfaces to be consistent for new Async paths (definitely breaks things) by @adamhathcock in adamhathcock/sharpcompress#1128 * More test fixes and some perf changes by @adamhathcock in adamhathcock/sharpcompress#1131 * Consolidate NETFRAMEWORK/NETSTANDARD compile flags into LEGACY_DOTNET by @Copilot in adamhathcock/sharpcompress#1135 * Add async I/O support for SevenZip archive initialization by @Copilot in adamhathcock/sharpcompress#1133 * Remove redundant stream field in AsyncOnlyStream by @Copilot in adamhathcock/sharpcompress#1138 * Replace empty catch blocks with explicit exception handling in TarArchive validation methods by @Copilot in adamhathcock/sharpcompress#1140 * Fix async test failures after xunit v3 upgrade by @Copilot in adamhathcock/sharpcompress#1137 * Upgrade xunit to v3 by @adamhathcock in adamhathcock/sharpcompress#1136 * Fix ReadFullyAsync with ArrayPool buffer in SevenZipArchive signature check by @Copilot in adamhathcock/sharpcompress#1142 * [WIP] Address feedback on async creation cleanup changes by @Copilot in adamhathcock/sharpcompress#1141 * Add leaveOpen parameter to LZipStream and BZip2Stream by @Copilot in adamhathcock/sharpcompress#1145 * Fix EntryStream.Dispose() throwing NotSupportedException on non-seekable streams by @Copilot in adamhathcock/sharpcompress#1151 * Fix dispose methods to always set _isDisposed and call base.Dispose() when LeaveOpen is true by @Copilot in adamhathcock/sharpcompress#1152 * Fix silent iteration failure when input stream throws on Flush() by @Copilot in adamhathcock/sharpcompress#1156 * release to master by @adamhathcock in adamhathcock/sharpcompress#1162 * Clean up for async creation by @adamhathcock in adamhathcock/sharpcompress#1132 * Fix infinite loop in SourceStream.Seek for malformed archives by @Copilot in adamhathcock/sharpcompress#1178 * [WIP] WIP address feedback on AOT props and cleanup by @Copilot in adamhathcock/sharpcompress#1182 * Add AOT to props and clean up in release by @adamhathcock in adamhathcock/sharpcompress#1181 * merge release to master by @adamhathcock in adamhathcock/sharpcompress#1174 * release to master merge by @adamhathcock in adamhathcock/sharpcompress#1183 * Some clean up post-async merging by @adamhathcock in adamhathcock/sharpcompress#1184 * Clean up again by @adamhathcock in adamhathcock/sharpcompress#1187 * Add automated performance benchmarks with BenchmarkDotNet by @Copilot in adamhathcock/sharpcompress#1188 * Bump csharpier from 1.2.5 to 1.2.6 by @dependabot[bot] in adamhathcock/sharpcompress#1192 * Change and clean up options by @adamhathcock in adamhathcock/sharpcompress#1193 * Fix archive extraction to preserve directory structure when options is null by @Copilot in adamhathcock/sharpcompress#1191 * Add LzwReader support for .Z compressed archives by @Copilot in adamhathcock/sharpcompress#1189 * add configure await by @adamhathcock in adamhathcock/sharpcompress#1195 ... (truncated) ## 0.44.5 ## What's Changed * Add [Obsolete] attribute to ReaderOptions.DefaultBufferSize for backward compatibility by @Copilot in adamhathcock/sharpcompress#1166 * Fix grammatical errors in ArcFactory comment documentation by @Copilot in adamhathcock/sharpcompress#1167 * (Release) Buffer size consolidation by @adamhathcock in adamhathcock/sharpcompress#1165 * Fix ZIP parsing failure on non-seekable streams with short reads by @Copilot in adamhathcock/sharpcompress#1169 * Fix SevenZipReader to maintain contiguous stream state for solid archives by @Copilot in adamhathcock/sharpcompress#1172 **Full Changelog**: adamhathcock/sharpcompress@0.44.4...0.44.5 ## 0.44.4 ## What's Changed * Fix ArrayPool corruption from double-disposal in BufferedSubStream by @Copilot in adamhathcock/sharpcompress#1161 * add check to see if we need to seek before hand by @adamhathcock in adamhathcock/sharpcompress#1160 **Full Changelog**: adamhathcock/sharpcompress@0.44.3...0.44.4 ## 0.44.3 ## What's Changed * Merge pull request #1156 from adamhathcock/copilot/fix-sharpcompress-… by @adamhathcock in adamhathcock/sharpcompress#1157 **Full Changelog**: adamhathcock/sharpcompress@0.44.2...0.44.3 ## 0.44.2 ## What's Changed * Adam/1151 release cherry pick by @adamhathcock in adamhathcock/sharpcompress#1154 same as adamhathcock/sharpcompress#1151 **Full Changelog**: adamhathcock/sharpcompress@0.44.1...0.44.2 ## 0.44.1 ## What's Changed * Merge pull request #1145 from adamhathcock/copilot/add-leaveopen-para… by @adamhathcock in adamhathcock/sharpcompress#1146 **Full Changelog**: adamhathcock/sharpcompress@0.44.0...0.44.1 ## 0.44.0 ## What's Changed * Configure nuget-release workflow to validate PRs without publishing by @Copilot in adamhathcock/sharpcompress#1099 * remove old release by @adamhathcock in adamhathcock/sharpcompress#1098 * Fix InvalidOperationException when RAR uncompressed size exceeds header value by @Copilot in adamhathcock/sharpcompress#1104 * Bump csharpier from 1.2.4 to 1.2.5 by @dependabot[bot] in adamhathcock/sharpcompress#1108 * Add support for ACE archives by @TwanVanDongen in adamhathcock/sharpcompress#1102 * Formats.md updated to reflect additions of Ace, Arc and Arj by @TwanVanDongen in adamhathcock/sharpcompress#1110 * Bump SimpleExec from 12.1.0 to 13.0.0 by @dependabot[bot] in adamhathcock/sharpcompress#1109 * Fix a usage of ReadOnly that use dispose in 7Zip by @adamhathcock in adamhathcock/sharpcompress#1113 * Fix async decompression of .7z files by implementing Memory<byte> ReadAsync overload by @Copilot in adamhathcock/sharpcompress#1114 * Update docs by @adamhathcock in adamhathcock/sharpcompress#1120 **Full Changelog**: adamhathcock/sharpcompress@0.43.0...0.44.0 ## 0.43.0 Big changes: Progress was redone to use IProgress. ZstdSharp was moved into the project. More groundwork for full async as well as more contributions and bug fixes! ## What's Changed * Drop .NET 6, .NET Standard 2.0, .NET 4.8.1, add .NET 10 support by @Copilot in adamhathcock/sharpcompress#1049 * Document ZipReader DirectoryEntry behavior and add verification test by @Copilot in adamhathcock/sharpcompress#1054 * Fix launch.json debug configurations to use net10.0 by @Copilot in adamhathcock/sharpcompress#1056 * add vscode config by @adamhathcock in adamhathcock/sharpcompress#1055 * Consolidate agent instructions into AGENTS.md by @Copilot in adamhathcock/sharpcompress#1058 * Agent instructions by @adamhathcock in adamhathcock/sharpcompress#1057 * Add archive-level password protection flags for 7z and rar by @HeroponRikiBestest in adamhathcock/sharpcompress#1060 * Add alternative option for writing TAR archives with USTAR header format by @drone1400 in adamhathcock/sharpcompress#1063 * Bump actions/upload-artifact from 5 to 6 by @dependabot[bot] in adamhathcock/sharpcompress#1071 * Bump csharpier from 1.2.1 to 1.2.3 by @dependabot[bot] in adamhathcock/sharpcompress#1072 * Move ZstdSharp into SharpCompress - Complete Integration by @Copilot in adamhathcock/sharpcompress#1052 * Unified progress reporting for compression and extraction operations by @Copilot in adamhathcock/sharpcompress#1044 * Fix async LZMA extraction bug for 7Zip archives by @Copilot in adamhathcock/sharpcompress#1081 * Standardize extraction API to WriteToDirectory with IProgress support by @Copilot in adamhathcock/sharpcompress#1080 * add extract all test by @adamhathcock in adamhathcock/sharpcompress#1076 * Bump JetBrains.Profiler.SelfApi from 2.5.14 to 2.5.15 by @dependabot[bot] in adamhathcock/sharpcompress#1082 * Avoid NotSupportedException overhead in SharpCompressStream for non-seekable streams by @Copilot in adamhathcock/sharpcompress#1084 * add some markdown files for planning by @adamhathcock in adamhathcock/sharpcompress#1085 * Remove ExtractAllEntries restriction for non-SOLID archives by @Copilot in adamhathcock/sharpcompress#1077 * Add back System.Buffers and System.Memory to central package management by @Copilot in adamhathcock/sharpcompress#1093 * Update dependencies by @adamhathcock in adamhathcock/sharpcompress#1091 * Add GitHub Actions workflow for automated NuGet releases with multi-platform builds by @Copilot in adamhathcock/sharpcompress#1095 ## New Contributors * @HeroponRikiBestest made their first contribution in adamhathcock/sharpcompress#1060 * @drone1400 made their first contribution in adamhathcock/sharpcompress#1063 **Full Changelog**: adamhathcock/sharpcompress@0.42.0...0.43.0 ## 0.42.1 ## What's Changed * Fix: Should not throw on ARJ detection by @adamhathcock in adamhathcock/sharpcompress#1067 **Full Changelog**: adamhathcock/sharpcompress@0.42.0...0.42.1 ## 0.42.0 This is one where I leaned heavily on AI for asynchronous implementation and bug fixes. ARJ is provided by @TwanVanDongen ## What's Changed * Configure Dependabot for NuGet updates by @adamhathcock in adamhathcock/sharpcompress#950 * Bump actions/setup-dotnet from 4 to 5 by @dependabot[bot] in adamhathcock/sharpcompress#957 * Bump actions/checkout from 4 to 5 by @dependabot[bot] in adamhathcock/sharpcompress#952 * Only allow extract all on archives that are solid (some rars and 7zip only) by @adamhathcock in adamhathcock/sharpcompress#964 * Remove a dynamically created stackalloc by @adamhathcock in adamhathcock/sharpcompress#966 * Bump AwesomeAssertions from 9.2.0 to 9.2.1 by @dependabot[bot] in adamhathcock/sharpcompress#961 * Reduce custom utilities for arrays/bytes by @adamhathcock in adamhathcock/sharpcompress#967 * rework dependencies to be correct for frameworks and update by @adamhathcock in adamhathcock/sharpcompress#968 * Removed wrappers that weren't needed (probably) by @adamhathcock in adamhathcock/sharpcompress#959 * Add JB perf testing project. by @adamhathcock in adamhathcock/sharpcompress#969 * Handle vendor-specific and malformed ZIP extra fields safely by @TwanVanDongen in adamhathcock/sharpcompress#972 * chore: add Copilot coding agent config and CI workflow by @adamhathcock in adamhathcock/sharpcompress#974 * Add Copilot agent manifest and usage documentation by @Copilot in adamhathcock/sharpcompress#977 * Bump actions/upload-artifact from 4 to 5 by @dependabot[bot] in adamhathcock/sharpcompress#979 * Add comprehensive async/await support for Stream I/O operations by @Copilot in adamhathcock/sharpcompress#978 * adds more async tests and overloads to make things writable and async by @adamhathcock in adamhathcock/sharpcompress#980 * Support CompressionType.None for uncompressed 7z files by @Copilot in adamhathcock/sharpcompress#986 * Configure Copilot coding agent instructions for SharpCompress by @Copilot in adamhathcock/sharpcompress#983 * Fix GZip extraction NotSupportedException for non-seekable streams by @Copilot in adamhathcock/sharpcompress#987 * Make all library exceptions inherit from SharpCompressException by @Copilot in adamhathcock/sharpcompress#990 * Add support for empty directory entries in archives by @Copilot in adamhathcock/sharpcompress#989 * Fix extraction failure on Windows due to case-sensitive path comparison by @Copilot in adamhathcock/sharpcompress#988 * Add more Async tests and complete Zip tests by @adamhathcock in adamhathcock/sharpcompress#991 * make test linux only by @adamhathcock in adamhathcock/sharpcompress#993 * Fix Windows test failures due to ArrayPool buffer sizing by @Copilot in adamhathcock/sharpcompress#1000 * Add Async RAR and more by @adamhathcock in adamhathcock/sharpcompress#996 * async bzip2 and add by @adamhathcock in adamhathcock/sharpcompress#1002 * Fix ArchiveFactory.Open double-wrapping causing "Cannot determine compressed stream type" on Linux by @Copilot in adamhathcock/sharpcompress#997 * Adding the ARJ (Archived by Robert Jung) format by @TwanVanDongen in adamhathcock/sharpcompress#994 * async lzma by @adamhathcock in adamhathcock/sharpcompress#1003 * Refactor SqueezeStream for CLS Compliance, Streaming, and Generic Test Coverage by @TwanVanDongen in adamhathcock/sharpcompress#1005 * ARJ multi-part archive handling improved by @TwanVanDongen in adamhathcock/sharpcompress#1006 * ArjReader throws exception for password protected archives. by @TwanVanDongen in adamhathcock/sharpcompress#1007 * Fix some IStreamStack and SharpCompressStream functions by @Morilli in adamhathcock/sharpcompress#1017 * ARJ's methods 1, 2 and 3 implemented for streaming by @TwanVanDongen in adamhathcock/sharpcompress#1019 * Async XZ by @adamhathcock in adamhathcock/sharpcompress#1004 * Fix memory exhaustion in TAR header auto-detection by @Copilot in adamhathcock/sharpcompress#1024 * Fix ArgumentNullException when disposing RarArchive with damaged archives by @Copilot in adamhathcock/sharpcompress#1025 * Buffer boundary tests by @TwanVanDongen in adamhathcock/sharpcompress#1028 * Added buffer boundary tests. by @TwanVanDongen in adamhathcock/sharpcompress#1030 * Update csharpier and reformat by @adamhathcock in adamhathcock/sharpcompress#1035 * Bump actions/checkout from 5 to 6 by @dependabot[bot] in adamhathcock/sharpcompress#1031 * Bump AwesomeAssertions from 9.2.1 to 9.3.0 by @dependabot[bot] in adamhathcock/sharpcompress#1009 * Fix version mismatch between Local File Header and Central Directory File Header in Zip archives by @Copilot in adamhathcock/sharpcompress#1023 * Fix DivideByZeroException when compressing empty files with BZip2 by @Copilot in adamhathcock/sharpcompress#1043 ## New Contributors ... (truncated) ## 0.41.0 ## What's Changed * Fix volume FileName property potentially missing by @Morilli in adamhathcock/sharpcompress#921 * Fix 7-zip solid archive detection by @Morilli in adamhathcock/sharpcompress#924 * fix DotSettings options to conform to current code style and editorconfig by @Morilli in adamhathcock/sharpcompress#928 * Fix zipentry comment implementation by @Morilli in adamhathcock/sharpcompress#929 * Added ArgumentException to Archive.Open implementations by @SimonCahill in adamhathcock/sharpcompress#931 * Implement `Attrib` for `ZipEntry` by @Morilli in adamhathcock/sharpcompress#933 * Added IStreamStack for debugging and configurable buffer management. … by @Nanook in adamhathcock/sharpcompress#930 * Zip ZStandard Writing with tests. Level support. by @Nanook in adamhathcock/sharpcompress#934 * Fix WinzipAesCryptoStream potentially not getting disposed by @Morilli in adamhathcock/sharpcompress#939 * Rewind buffer fix for directory extract. by @Nanook in adamhathcock/sharpcompress#935 * ZStandard tar support by @mitchcapper in adamhathcock/sharpcompress#943 * Extension hinting for ReaderFactory for better first try factory success by @mitchcapper in adamhathcock/sharpcompress#945 * Update dependencies and csharpier by @adamhathcock in adamhathcock/sharpcompress#947 * update to 0.41.0 and change symbols type by @adamhathcock in adamhathcock/sharpcompress#948 ## New Contributors * @SimonCahill made their first contribution in adamhathcock/sharpcompress#931 * @mitchcapper made their first contribution in adamhathcock/sharpcompress#943 **Full Changelog**: adamhathcock/sharpcompress@0.40.0...0.41.0 ## 0.40.0 ## What's Changed * don't run net48 on non-windows by @adamhathcock in adamhathcock/sharpcompress#892 * Fix zip entry handling for entries with data descriptors by @Morilli in adamhathcock/sharpcompress#891 * Fix for Rar4 v20 compression. by @Nanook in adamhathcock/sharpcompress#893 * use File.OpenRead instead of File.Open in tests to allow concurrent access by @Morilli in adamhathcock/sharpcompress#895 * Fix condition in rar v3 code by @Morilli in adamhathcock/sharpcompress#894 * Rar2 v20,v26 Multimedia (Audio) decoder fix by @Nanook in adamhathcock/sharpcompress#896 * Implement ReadByte for LzmaStream and LzOutWindow by @Morilli in adamhathcock/sharpcompress#898 * Implement ReadByte for BufferedSubStream by @Morilli in adamhathcock/sharpcompress#897 * make WriteToDirectory functions use ExtractAllEntries by @Morilli in adamhathcock/sharpcompress#900 * Handle XZ CheckType SHA-256 by @ms264556 in adamhathcock/sharpcompress#901 * Provide access to extended attributes for 7-zip by @jdpurcell in adamhathcock/sharpcompress#904 * Base Reader implementation of .ARC format by @TwanVanDongen in adamhathcock/sharpcompress#903 * ARC decompression methods 3 and 4 added by @TwanVanDongen in adamhathcock/sharpcompress#905 * Added ARC's crunched methods 5, 6, 7 & 8 by @TwanVanDongen in adamhathcock/sharpcompress#906 * Optimize LZ OutWindow.CopyBlock by @jdpurcell in adamhathcock/sharpcompress#907 * Optimize LZMA range decoder by @jdpurcell in adamhathcock/sharpcompress#910 * Update USAGE.md to remove problematic extraction example by @Morilli in adamhathcock/sharpcompress#909 * Optimize BufferedSubStream.ReadByte by @jdpurcell in adamhathcock/sharpcompress#912 * Fix regression with BufferedSubStream calculation by @jdpurcell in adamhathcock/sharpcompress#913 * Add SharpCompressException and use it or children in most places by @adamhathcock in adamhathcock/sharpcompress#834 * return Stream.Null when 7z entry has no stream by @zgabi in adamhathcock/sharpcompress#854 * Implement multipart rar handling for ExtractAllEntries by @Morilli in adamhathcock/sharpcompress#916 * [bzip2] fix possible out of bounds access due to unsanitized nSelectors usage by @Morilli in adamhathcock/sharpcompress#918 * Update dependencies and csharpier by @adamhathcock in adamhathcock/sharpcompress#914 ## New Contributors * @ms264556 made their first contribution in adamhathcock/sharpcompress#901 * @jdpurcell made their first contribution in adamhathcock/sharpcompress#904 * @zgabi made their first contribution in adamhathcock/sharpcompress#854 **Full Changelog**: adamhathcock/sharpcompress@0.39.0...0.40.0 ## 0.39.0 ## What's Changed * Restore stream position in ArchiveFactory.IsArchive by @Morilli in adamhathcock/sharpcompress#876 * Fixed bug in zip time header flags by @StarkDirewolf in adamhathcock/sharpcompress#877 * Exports unclutter by @YoshiRulz in adamhathcock/sharpcompress#884 * Fix XZBlock padding calculation when its stream's starting position % 4 != 0 by @Morilli in adamhathcock/sharpcompress#878 * Improve rar memory usage by @majorro in adamhathcock/sharpcompress#887 * Make helper classes internal by @majorro in adamhathcock/sharpcompress#889 * Update to support net48, net481, netstandard2.0, net6 and net8 by @adamhathcock in adamhathcock/sharpcompress#888 ## New Contributors * @StarkDirewolf made their first contribution in adamhathcock/sharpcompress#877 * @YoshiRulz made their first contribution in adamhathcock/sharpcompress#884 * @majorro made their first contribution in adamhathcock/sharpcompress#887 **Full Changelog**: adamhathcock/sharpcompress@0.38.0...0.39.0 ## 0.38.0 ## What's Changed * Tar: Add processing for the LongLink header type by @DannyBoyk in adamhathcock/sharpcompress#847 * Fix gzip archives having a `Type` of `ArchiveType.Tar` instead of `ArchiveType.Gzip` by @Morilli in adamhathcock/sharpcompress#848 * Fix for issue #844 by @Erior in adamhathcock/sharpcompress#849 * Issue 842 by @Erior in adamhathcock/sharpcompress#850 * Fixed extractions after first ZIP64 entry is read from stream by @pathartl in adamhathcock/sharpcompress#852 * Check crc on tar header by @Erior in adamhathcock/sharpcompress#855 * Fix for missing empty directories when using ExtractToDirectory by @alexprabhat99 in adamhathcock/sharpcompress#857 * Added Explode and (un)Reduce by @gjefferyes in adamhathcock/sharpcompress#853 * Fix #858 - Replaces invalid filename characters by @DineshSolanki in adamhathcock/sharpcompress#859 * Added support for 7zip SFX archives by @lostmsu in adamhathcock/sharpcompress#860 * Update csproj to get green marks and update deps by @adamhathcock in adamhathcock/sharpcompress#864 * Added shrink, reduce and implode to FORMATS by @TwanVanDongen in adamhathcock/sharpcompress#866 * Fix small typo in USAGE.md by @kikaragyozov in adamhathcock/sharpcompress#868 ## New Contributors * @Morilli made their first contribution in adamhathcock/sharpcompress#848 * @alexprabhat99 made their first contribution in adamhathcock/sharpcompress#857 * @gjefferyes made their first contribution in adamhathcock/sharpcompress#853 * @DineshSolanki made their first contribution in adamhathcock/sharpcompress#859 * @lostmsu made their first contribution in adamhathcock/sharpcompress#860 * @kikaragyozov made their first contribution in adamhathcock/sharpcompress#868 **Full Changelog**: adamhathcock/sharpcompress@0.37.2...0.38.0 ## 0.37.2 **Full Changelog**: adamhathcock/sharpcompress@0.37.1...0.37.2 ## 0.37.1 ## What's Changed * Prevent infinite loop when reading corrupted archive by @Blokyk in adamhathcock/sharpcompress#835 ## New Contributors * @Blokyk made their first contribution in adamhathcock/sharpcompress#835 **Full Changelog**: adamhathcock/sharpcompress@0.37.0...0.37.1 Updated ZstdSharp.Port to be native Private assets for github link? ## 0.37.0 ## What's Changed * Zip: Use last modified time from basic header when validating zip decryption by @DannyBoyk in adamhathcock/sharpcompress#805 * Support for decompressing Zip Shrink (Method:1) by @TwanVanDongen in adamhathcock/sharpcompress#807 * rar5 read FHEXTRA_REDIR and expose via RarEntry by @coderb in adamhathcock/sharpcompress#814 * rar5 improve memory usage by @coderb in adamhathcock/sharpcompress#816 * Code clean up by @adamhathcock in adamhathcock/sharpcompress#815 * #809 Add README.md to csproj for NuGet by @btomblinson in adamhathcock/sharpcompress#817 * Support added for TAR LZW compression (Unix 'compress' resulting in .… by @TwanVanDongen in adamhathcock/sharpcompress#819 * Add support for 7z ARM64 and RISCV filters by @klimatr26 in adamhathcock/sharpcompress#823 * Fix tar corruption when sizes mismatch by @adamhathcock in adamhathcock/sharpcompress#825 * Update README.md - Change API Docs to DNDocs by @NeuroXiq in adamhathcock/sharpcompress#829 * Remove ignored nulls by @adamhathcock in adamhathcock/sharpcompress#832 * Remove ~netstandard20~ just net7.0 by @adamhathcock in adamhathcock/sharpcompress#828 ## New Contributors * @klimatr26 made their first contribution in adamhathcock/sharpcompress#823 * @NeuroXiq made their first contribution in adamhathcock/sharpcompress#829 **Full Changelog**: adamhathcock/sharpcompress@0.36.0...0.37.0 ## 0.36.0 ## What's Changed * ZipWriter: Write correct EOCD record when more than 65,535 files by @DannyBoyk in adamhathcock/sharpcompress#792 * Feature/rar5 blake2 by @Erior in adamhathcock/sharpcompress#794 * Issue 771, remove throw on flush for readonly streams by @Erior in adamhathcock/sharpcompress#801 * Set Empty string for Rar5 password as default by @Erior in adamhathcock/sharpcompress#798 * Expose file attributes for rar by @Erior in adamhathcock/sharpcompress#800 * Fix reporting size / position by @Erior in adamhathcock/sharpcompress#799 * Add support for the UnixTimeExtraField in Zip files by @DannyBoyk in adamhathcock/sharpcompress#803 **Full Changelog**: adamhathcock/sharpcompress@0.35.0...0.36.0 ## 0.35.0 ## What's Changed * Dont crash on reading rar5 comment #783 by @Erior in adamhathcock/sharpcompress#784 * Handle tar files generated with tar -H oldgnu that has large uid/gid values by @Erior in adamhathcock/sharpcompress#785 * LZMA EOS marker detection by @Erior in adamhathcock/sharpcompress#786 * Bump actions/setup-dotnet from 3 to 4 by @dependabot in adamhathcock/sharpcompress#787 * RAR5 decryption support by @Erior in adamhathcock/sharpcompress#788 * Dotnet8 by @adamhathcock in adamhathcock/sharpcompress#789 **Full Changelog**: adamhathcock/sharpcompress@0.34.2...0.35.0 ## 0.34.2 ## What's Changed * Throw ReaderCancelledException on reader cancelled by @pathartl in adamhathcock/sharpcompress#778 * Update csharpier and fix formatting by @adamhathcock in adamhathcock/sharpcompress#781 * Revert change disabling strong name signing in 92df1ec by @caesay in adamhathcock/sharpcompress#780 ## New Contributors * @pathartl made their first contribution in adamhathcock/sharpcompress#778 * @caesay made their first contribution in adamhathcock/sharpcompress#780 **Full Changelog**: adamhathcock/sharpcompress@0.34.1...0.34.2 ## 0.34.1 ## What's Changed * Feature/761 by @Erior in adamhathcock/sharpcompress#768 * Update Zstd to 0.7.2 by @Erior in adamhathcock/sharpcompress#769 **Full Changelog**: adamhathcock/sharpcompress@0.34.0...0.34.1 ## 0.34.0 ## What's Changed * Check for broken file #736 by @Erior in adamhathcock/sharpcompress#737 * Make ArchiveFactory.IsArchive(Stream, ...) public. Fix #739 by @AlissaSabre in adamhathcock/sharpcompress#740 * Skip if we know the size, set blank password if not set for rar by @Erior in adamhathcock/sharpcompress#745 * Added simple example by @rodesfl in adamhathcock/sharpcompress#746 * Adds zstd (zstandard) support to zip/zipx and 7zip by @Nanook in adamhathcock/sharpcompress#723 * Add fast `ExtractToDirectoryAsync` extension method on `IArchive` by @FlsZen in adamhathcock/sharpcompress#750 * Bump actions/checkout from 3 to 4 by @dependabot in adamhathcock/sharpcompress#758 * Feature/748 by @Erior in adamhathcock/sharpcompress#759 * #751 Add .tar.7z support by @btomblinson in adamhathcock/sharpcompress#763 ## New Contributors * @AlissaSabre made their first contribution in adamhathcock/sharpcompress#740 * @rodesfl made their first contribution in adamhathcock/sharpcompress#746 * @FlsZen made their first contribution in adamhathcock/sharpcompress#750 * @btomblinson made their first contribution in adamhathcock/sharpcompress#763 **Full Changelog**: adamhathcock/sharpcompress@0.33.0...0.34.0 ## 0.33.0 I think the API didn't break with `IArchiveFactory` I've been out it for health reasons ## What's Changed * SourceStream Position counting bug fix by @Erior in adamhathcock/sharpcompress#687 * Access level to LzmaStream Decoder by @louis-michelbergeron in adamhathcock/sharpcompress#690 * Introduced IArchiveFactory by @vpenades in adamhathcock/sharpcompress#671 * 64bit datadescriptors by @Erior in adamhathcock/sharpcompress#689 * Ignores UnicodePathExtra if forced encoding is specified by @stakira in adamhathcock/sharpcompress#696 * Added support for reading comment header for Rar v5 archives by @IngBertolini in adamhathcock/sharpcompress#697 * Bump actions/setup-dotnet from 2 to 3 by @dependabot in adamhathcock/sharpcompress#699 * Use PackageLicenseExpression instead of PackageLicenseFile by @andreas-eriksson in adamhathcock/sharpcompress#706 * Generalized factories to readers and writers. by @vpenades in adamhathcock/sharpcompress#709 * Update to dotnet 7. Change net461 to net462. Remove netcoreapp3.1 by @adamhathcock in adamhathcock/sharpcompress#715 * replace Activator.CreateInstance to Func for avoiding error in NativeAOT by @itn3000 in adamhathcock/sharpcompress#716 * Several improvements to the LZMA Compressor by @ds5678 in adamhathcock/sharpcompress#717 * Zip Multipart fix, XZ stream fix, XZ stream support added to zip/zipx by @Nanook in adamhathcock/sharpcompress#722 * Add support for 7ZipDelta decompress by @Erior in adamhathcock/sharpcompress#726 * Fixed support for RAR 1.5 (algo15) by @TwanVanDongen in adamhathcock/sharpcompress#729 * Implement Searching Data Descriptor stream issue/pull #680 by @Erior in adamhathcock/sharpcompress#727 * Increase character value to support rar file with more than 100 parts… by @Erior in adamhathcock/sharpcompress#733 * Remove check for minimal distance and add test case generated by 7z as compatibility check by @Erior in adamhathcock/sharpcompress#735 ## New Contributors * @vpenades made their first contribution in adamhathcock/sharpcompress#671 * @stakira made their first contribution in adamhathcock/sharpcompress#696 * @IngBertolini made their first contribution in adamhathcock/sharpcompress#697 * @TwanVanDongen made their first contribution in adamhathcock/sharpcompress#729 **Full Changelog**: adamhathcock/sharpcompress@0.32.2...0.33.0 ## 0.32.2 ## What's Changed * ReadOnlySubStream overrides and adds logic #636 by @Erior in adamhathcock/sharpcompress#675 * Fix LZMADecoder Code function by @louis-michelbergeron in adamhathcock/sharpcompress#679 * RarArchive has Min/MaxVersion. RarEntry has Volumne Indexes. GZ CRC fix. by @Nanook in adamhathcock/sharpcompress#682 * Include license in nuget package by @daverant in adamhathcock/sharpcompress#684 * WriteAll: use delegate instead of Expression by @OwnageIsMagic in adamhathcock/sharpcompress#683 * Mitigation of problems by @Erior in adamhathcock/sharpcompress#686 ## New Contributors * @daverant made their first contribution in adamhathcock/sharpcompress#684 * @OwnageIsMagic made their first contribution in adamhathcock/sharpcompress#683 **Full Changelog**: adamhathcock/sharpcompress@0.32.1...0.32.2 ## 0.32.1 ## What's Changed * Feature/malformed zip file generated by @Erior in adamhathcock/sharpcompress#673 * Suppress nested NonDisposingStream by @MartinDemberger in adamhathcock/sharpcompress#674 * Corrected skip-marker on skip of uncompressed ZIP file with missing size informations. by @MartinDemberger in adamhathcock/sharpcompress#672 ## New Contributors * @MartinDemberger made their first contribution in adamhathcock/sharpcompress#674 **Full Changelog**: adamhathcock/sharpcompress@0.32...0.32.1 ## 0.32 ## What's Changed * Add a net 6 target and make trimmable by @ds5678 in adamhathcock/sharpcompress#652 * Tar file mode, user and group by @Ryhon0 in adamhathcock/sharpcompress#655 * Added Split archive support with unit tests. … by @Nanook in adamhathcock/sharpcompress#658 * Dependency updates and start of enforcing some C# standards by @adamhathcock in adamhathcock/sharpcompress#659 * Bump actions/upload-artifact from 2 to 3 by @dependabot in adamhathcock/sharpcompress#660 * Added multipart Zip support (z01...). Added IEntry.IsSolid by @Nanook in adamhathcock/sharpcompress#661 * Properly integrated zip multivolume and general split support. by @Nanook in adamhathcock/sharpcompress#662 * Align behavour of 7Zip exception with encrypted filenames arc with rar when no password provided by @Nanook in adamhathcock/sharpcompress#663 * XZ decoding BCJ filters support by @louis-michelbergeron in adamhathcock/sharpcompress#669 ## New Contributors * @ds5678 made their first contribution in adamhathcock/sharpcompress#652 * @Ryhon0 made their first contribution in adamhathcock/sharpcompress#655 * @dependabot made their first contribution in adamhathcock/sharpcompress#660 * @louis-michelbergeron made their first contribution in adamhathcock/sharpcompress#669 **Full Changelog**: adamhathcock/sharpcompress@0.31...0.32 ## 0.31 ## What's Changed * Rar2 fix with new unit tests that fail on previous build. by @Nanook in adamhathcock/sharpcompress#638 * Update Adler32 from ImageSharp v2.1.0 by @loop-evgeny in adamhathcock/sharpcompress#651 ## New Contributors * @loop-evgeny made their first contribution in adamhathcock/sharpcompress#651 **Full Changelog**: adamhathcock/sharpcompress@0.30.1...0.31 ## 0.30.1 ## What's Changed * Add test and probable fix for Issue 617 by @adamhathcock in adamhathcock/sharpcompress#624 **Full Changelog**: adamhathcock/sharpcompress@0.30.0...0.30.1 ## 0.30 I accepted a PR to add `net461` back as there's still multi-targetting issues. I guess .NET Standard 2.0 never really worked out. Included that and a fix: - Add net461 target to clean up issues with system.* nuget dependencies adamhathcock/sharpcompress#621 - Fix for chunked read for ZLibBaseStream adamhathcock/sharpcompress#616 https://www.nuget.org/packages/SharpCompress/0.30.0 Commits viewable in [compare view](adamhathcock/sharpcompress@0.29.0...0.48.0). </details> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/dekthaiinchina/GoldbergGUI/network/alerts). </details>
#1196
This pull request introduces support for custom compression providers throughout the SharpCompress library, allowing users to swap out the built-in compression implementations for alternatives (such as using
System.IO.Compressionfor GZip/Deflate). The changes include updates to the API, documentation, and internal handling of compression streams to make the provider registry configurable and accessible wherever compression or decompression occurs.API and Core Library Updates:
Providersproperty of typeCompressionProviderRegistryto bothReaderOptionsandWriterOptions, allowing users to specify custom compression providers. This property defaults to the built-in registry but can be overridden as needed. [1] [2] [3]GZipFilePart,SeekableZipFilePart,StreamingZipFilePart, andZipFilePartto accept and use theCompressionProviderRegistryfor creating decompression streams, replacing hardcoded usage of built-in codecs. [1] [2] [3] [4] [5] [6] [7]Providersregistry from options to file part constructors, ensuring the custom provider is used throughout. [1] [2] [3] [4] [5] [6]Documentation Improvements:
README.md,docs/API.md, anddocs/USAGE.mdexplaining how to configure and use custom compression providers, with code samples and guidance for replacing or extending built-in codecs. [1] [2] [3]Internal Refactoring:
GZipFilePartandZipFilePartto use the provider registry, removing direct references to specific codec classes and making the implementation more flexible. [1] [2]DeflateStreamin favor of using the provider registry abstraction.These changes make it much easier to integrate alternative or third-party compression libraries, improve testability, and allow for more flexible deployment scenarios.