Skip to content

Conversation

@adamhathcock
Copy link
Owner

Trust the framework

@adamhathcock adamhathcock requested a review from Copilot October 22, 2025 08:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the utility library by removing custom implementations in favor of framework-provided functionality. The changes reduce maintenance burden and leverage well-tested platform APIs, particularly for stream operations and array handling.

Key changes include:

  • Replacing custom TransferTo with framework's CopyTo for stream operations
  • Using Buffer.BlockCopy instead of custom array copy wrapper
  • Consolidating namespace structure by removing the Helpers namespace
  • Adding comprehensive unit tests for existing utility methods

Reviewed Changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/SharpCompress.Test/UtilityTests.cs Adds comprehensive test coverage for utility methods including URShift, ReadFully, Skip, date conversions, and other helper functions
tests/SharpCompress.Test/TestBase.cs Removes global using directive for Helpers namespace
tests/SharpCompress.Test/Tar/TarReaderTests.cs Replaces TransferTo with standard CopyTo
tests/SharpCompress.Test/Rar/RarReaderTests.cs Replaces TransferTo with standard CopyTo
src/SharpCompress/Writers/Zip/ZipWriter.cs Replaces TransferTo with standard CopyTo
src/SharpCompress/Writers/GZip/GZipWriter.cs Replaces TransferTo with standard CopyTo
src/SharpCompress/Utility.cs Removes custom array copy, TransferTo overloads, Find, CheckNotNull methods; refactors Skip methods; adds NET60_OR_GREATER conditional compilation for ReadFully
src/SharpCompress/Readers/Zip/ZipReader.cs Updates CheckNotNull to NotNull
src/SharpCompress/Readers/Tar/TarReader.cs Updates CheckNotNull to NotNull
src/SharpCompress/Readers/ReaderFactory.cs Updates CheckNotNullOrEmpty to NotNullOrEmpty and CheckNotNull to NotNull
src/SharpCompress/Readers/Rar/RarReader.cs Updates CheckNotNullOrEmpty to NotNullOrEmpty and CheckNotNull to NotNull
src/SharpCompress/Readers/GZip/GZipReader.cs Updates CheckNotNull to NotNull
src/SharpCompress/Readers/Arc/ArcReader.cs Updates CheckNotNull to NotNull
src/SharpCompress/NotNullExtensions.cs Adds NotNullOrEmpty method and updates Empty methods to use collection expression syntax
src/SharpCompress/LazyReadOnlyCollection.cs Updates namespace from Helpers to SharpCompress
src/SharpCompress/Factories/Factory.cs Updates CheckNotNull to NotNull
src/SharpCompress/Compressors/Rar/UnpackV2017/Unpack.unpack50_cpp.cs Replaces custom Copy with Buffer.BlockCopy
src/SharpCompress/Archives/Zip/ZipArchive.cs Updates CheckNotNullOrEmpty to NotNull and CheckNotNull to NotNull
src/SharpCompress/Archives/Tar/TarArchive.cs Updates CheckNotNullOrEmpty to NotNullOrEmpty and CheckNotNull to NotNull; replaces TransferTo with CopyTo
src/SharpCompress/Archives/SevenZip/SevenZipArchive.cs Updates CheckNotNullOrEmpty to NotNullOrEmpty and CheckNotNull to NotNull
src/SharpCompress/Archives/Rar/RarArchive.cs Updates CheckNotNullOrEmpty to NotNullOrEmpty and CheckNotNull to NotNull
src/SharpCompress/Archives/IArchiveEntryExtensions.cs Replaces TransferTo with standard CopyTo
src/SharpCompress/Archives/GZip/GZipArchive.cs Updates CheckNotNullOrEmpty to NotNullOrEmpty and CheckNotNull to NotNull
src/SharpCompress/Archives/ArchiveFactory.cs Updates CheckNotNullOrEmpty to NotNullOrEmpty and CheckNotNull to NotNull

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@adamhathcock adamhathcock requested a review from Copilot October 22, 2025 09:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 24 out of 24 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants