From 237ff9f055be7834eb598e37236030f9c9434fff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20=C4=90=E1=BB=A9c=20Long?= Date: Thu, 18 Mar 2021 17:46:18 +0700 Subject: [PATCH] Do not place extension classes in common namespace --- src/SharpCompress/Polyfills/StreamExtensions.cs | 10 ++++++---- src/SharpCompress/Polyfills/StringExtensions.cs | 8 ++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/SharpCompress/Polyfills/StreamExtensions.cs b/src/SharpCompress/Polyfills/StreamExtensions.cs index 63c848341..fe59f96ef 100644 --- a/src/SharpCompress/Polyfills/StreamExtensions.cs +++ b/src/SharpCompress/Polyfills/StreamExtensions.cs @@ -1,12 +1,14 @@ #if NET461 || NETSTANDARD2_0 +using System; using System.Buffers; +using System.IO; -namespace System.IO +namespace SharpCompress { - public static class StreamExtensions + internal static class StreamExtensions { - public static int Read(this Stream stream, Span buffer) + internal static int Read(this Stream stream, Span buffer) { byte[] temp = ArrayPool.Shared.Rent(buffer.Length); @@ -24,7 +26,7 @@ public static int Read(this Stream stream, Span buffer) } } - public static void Write(this Stream stream, ReadOnlySpan buffer) + internal static void Write(this Stream stream, ReadOnlySpan buffer) { byte[] temp = ArrayPool.Shared.Rent(buffer.Length); diff --git a/src/SharpCompress/Polyfills/StringExtensions.cs b/src/SharpCompress/Polyfills/StringExtensions.cs index b27696e6b..f46461893 100644 --- a/src/SharpCompress/Polyfills/StringExtensions.cs +++ b/src/SharpCompress/Polyfills/StringExtensions.cs @@ -1,15 +1,15 @@ #if NET461 || NETSTANDARD2_0 -namespace System +namespace SharpCompress { - public static class StringExtensions + internal static class StringExtensions { - public static bool EndsWith(this string text, char value) + internal static bool EndsWith(this string text, char value) { return text.Length > 0 && text[text.Length - 1] == value; } - public static bool Contains(this string text, char value) + internal static bool Contains(this string text, char value) { return text.IndexOf(value) > -1; }