diff --git a/src/Ramstack.FileProviders.Composition/ChangeTokenComposer.cs b/src/Ramstack.FileProviders.Composition/ChangeTokenComposer.cs
index f938784..c26325f 100644
--- a/src/Ramstack.FileProviders.Composition/ChangeTokenComposer.cs
+++ b/src/Ramstack.FileProviders.Composition/ChangeTokenComposer.cs
@@ -17,7 +17,7 @@ public static class ChangeTokenComposer
///
/// The to flatten.
///
- /// An representing the flattened version from the specified .
+ /// An representing the flattened version of the specified .
///
public static IChangeToken Flatten(this IChangeToken changeToken) =>
FlattenChangeToken(changeToken);
@@ -31,7 +31,7 @@ public static IChangeToken Flatten(this IChangeToken changeToken) =>
///
/// The to flatten.
///
- /// An representing the flattened version from the specified .
+ /// An representing the flattened version of the specified .
///
public static IChangeToken FlattenChangeToken(IChangeToken changeToken)
{
@@ -65,7 +65,7 @@ public static IChangeToken FlattenChangeToken(IChangeToken changeToken)
///
/// The list of instances to compose and flatten.
///
- /// An representing the flattened version from the specified list of tokens.
+ /// An representing the flattened version of the specified list of tokens.
///
public static IChangeToken ComposeChangeTokens(params IChangeToken[] changeTokens) =>
ComposeChangeTokens((IReadOnlyList)changeTokens);
@@ -78,7 +78,7 @@ public static IChangeToken ComposeChangeTokens(params IChangeToken[] changeToken
///
/// The list of instances to compose and flatten.
///
- /// An representing the flattened version from the specified list of tokens.
+ /// An representing the flattened version of the specified list of tokens.
///
public static IChangeToken ComposeChangeTokens(IReadOnlyList changeTokens)
{
@@ -120,7 +120,7 @@ public static IChangeToken ComposeChangeTokens(IReadOnlyList chang
///
/// The list of instances to compose and flatten.
///
- /// An representing the flattened version from the specified list of tokens.
+ /// An representing the flattened version of the specified list of tokens.
///
public static IChangeToken ComposeChangeTokens(IEnumerable changeTokens)
{
diff --git a/src/Ramstack.FileProviders.Composition/FileProviderComposer.cs b/src/Ramstack.FileProviders.Composition/FileProviderComposer.cs
index ac1d134..e33afc1 100644
--- a/src/Ramstack.FileProviders.Composition/FileProviderComposer.cs
+++ b/src/Ramstack.FileProviders.Composition/FileProviderComposer.cs
@@ -16,7 +16,7 @@ public static class FileProviderComposer
///
/// The to flatten.
///
- /// An representing the flattened version from the specified .
+ /// An representing the flattened version of the specified .
///
public static IFileProvider Flatten(this IFileProvider provider) =>
FlattenProvider(provider);
@@ -30,7 +30,7 @@ public static IFileProvider Flatten(this IFileProvider provider) =>
///
/// The to flatten.
///
- /// An representing the flattened version from the specified .
+ /// An representing the flattened version of the specified .
///
public static IFileProvider FlattenProvider(IFileProvider provider)
{
@@ -64,7 +64,7 @@ public static IFileProvider FlattenProvider(IFileProvider provider)
///
/// The list of instances to compose and flatten.
///
- /// An representing the flattened version from the specified list of providers.
+ /// An representing the flattened version of the specified list of providers.
///
public static IFileProvider ComposeProviders(params IFileProvider[] providers) =>
ComposeProviders(providers.AsEnumerable());
@@ -77,7 +77,7 @@ public static IFileProvider ComposeProviders(params IFileProvider[] providers) =
///
/// The list of instances to compose and flatten.
///
- /// An representing the flattened version from the specified list of providers.
+ /// An representing the flattened version of the specified list of providers.
///
public static IFileProvider ComposeProviders(IEnumerable providers)
{
diff --git a/src/Ramstack.FileProviders.Extensions/DirectoryNode.cs b/src/Ramstack.FileProviders.Extensions/DirectoryNode.cs
index 4cec2e1..62eb40a 100644
--- a/src/Ramstack.FileProviders.Extensions/DirectoryNode.cs
+++ b/src/Ramstack.FileProviders.Extensions/DirectoryNode.cs
@@ -14,7 +14,7 @@ public sealed class DirectoryNode : FileNodeBase
public bool IsRoot => FullName == "/";
///
- /// Gets an instance representing the root directory.
+ /// Gets a instance representing the root directory.
///
public DirectoryNode Root
{
@@ -29,7 +29,7 @@ public DirectoryNode Root
}
///
- /// Gets an instance representing the parent directory.
+ /// Gets a instance representing the parent directory.
///
public DirectoryNode? Parent
{
@@ -103,7 +103,7 @@ public IEnumerable EnumerateFiles()
}
///
- /// Returns an enumerable collection of files in the current directory.
+ /// Returns an enumerable collection of directories in the current directory.
///
///
/// An enumerable collection of directories in the current directory.
diff --git a/src/Ramstack.FileProviders.Extensions/DirectoryNodeExtensions.cs b/src/Ramstack.FileProviders.Extensions/DirectoryNodeExtensions.cs
index 75bbd43..3ceef8a 100644
--- a/src/Ramstack.FileProviders.Extensions/DirectoryNodeExtensions.cs
+++ b/src/Ramstack.FileProviders.Extensions/DirectoryNodeExtensions.cs
@@ -4,7 +4,7 @@
namespace Ramstack.FileProviders;
///
-/// Provides extension methods for class.
+/// Provides extension methods for the class.
///
public static class DirectoryNodeExtensions
{
@@ -40,7 +40,7 @@ public static class DirectoryNodeExtensions
///
/// -
///
- /// Brace patterns are supported, including nested brace pattern:
+ /// Brace patterns are supported, including nested brace patterns:
/// {file,dir,name}, {file-1.{c,cpp},file-2.{cs,f}}
///
///
@@ -100,7 +100,7 @@ public static IEnumerable EnumerateFiles(this DirectoryNode directory,
///
/// -
///
- /// Brace patterns are supported, including nested brace pattern:
+ /// Brace patterns are supported, including nested brace patterns:
/// {file,dir,name}, {file-1.{c,cpp},file-2.{cs,f}}
///
///
@@ -172,7 +172,7 @@ public static IEnumerable EnumerateFiles(this DirectoryNode directory,
///
/// -
///
- /// Brace patterns are supported, including nested brace pattern:
+ /// Brace patterns are supported, including nested brace patterns:
/// {file,dir,name}, {file-1.{c,cpp},file-2.{cs,f}}
///
///
@@ -207,7 +207,7 @@ public static IEnumerable EnumerateDirectories(this DirectoryNode
/// An array of glob patterns to match against the names of directories.
/// An optional array of glob patterns to exclude directories.
///
- /// An enumerable collection of directories in the specified that match any of the given glob patterns.
+ /// An enumerable collection of directories in the specified directory that match any of the given glob patterns.
///
///
/// Glob pattern:
@@ -232,7 +232,7 @@ public static IEnumerable EnumerateDirectories(this DirectoryNode
///
/// -
///
- /// Brace patterns are supported, including nested brace pattern:
+ /// Brace patterns are supported, including nested brace patterns:
/// {file,dir,name}, {file-1.{c,cpp},file-2.{cs,f}}
///
///
@@ -305,7 +305,7 @@ public static IEnumerable EnumerateDirectories(this DirectoryNode
///
/// -
///
- /// Brace patterns are supported, including nested brace pattern:
+ /// Brace patterns are supported, including nested brace patterns:
/// {file,dir,name}, {file-1.{c,cpp},file-2.{cs,f}}
///
///
@@ -365,7 +365,7 @@ public static IEnumerable EnumerateFileNodes(this DirectoryNode di
///
/// -
///
- /// Brace patterns are supported, including nested brace pattern:
+ /// Brace patterns are supported, including nested brace patterns:
/// {file,dir,name}, {file-1.{c,cpp},file-2.{cs,f}}
///
///
diff --git a/src/Ramstack.FileProviders.Extensions/FileInfoExtensions.cs b/src/Ramstack.FileProviders.Extensions/FileInfoExtensions.cs
index 4f03be5..5679723 100644
--- a/src/Ramstack.FileProviders.Extensions/FileInfoExtensions.cs
+++ b/src/Ramstack.FileProviders.Extensions/FileInfoExtensions.cs
@@ -9,11 +9,11 @@ namespace Ramstack.FileProviders;
public static class FileInfoExtensions
{
///
- /// Returns file contents as readonly stream.
+ /// Returns file contents as a read-only stream.
///
/// The .
///
- /// The file contents as readonly stream.
+ /// The file contents as a read-only stream.
///
public static Stream OpenRead(this IFileInfo file) =>
file.CreateReadStream();
@@ -130,7 +130,7 @@ static byte[] ReadAllBytesUnknownLengthImpl(Stream stream)
}
///
- /// Asynchronously reads all the text in the current file with the specified encoding.
+ /// Asynchronously reads all the text in the current file.
///
/// The file from which to read the entire text content.
/// An optional cancellation token to cancel the operation.
@@ -139,7 +139,7 @@ static byte[] ReadAllBytesUnknownLengthImpl(Stream stream)
/// containing the full text from the current file.
///
public static ValueTask ReadAllTextAsync(this IFileInfo file, CancellationToken cancellationToken = default) =>
- ReadAllTextAsync(file, Encoding.UTF8, cancellationToken);
+ ReadAllTextAsync(file, null, cancellationToken);
///
/// Asynchronously reads all the text in the current file with the specified encoding.
@@ -297,20 +297,19 @@ static async ValueTask ReadAllBytesUnknownLengthImplAsync(Stream stream,
}
}
- private static byte[] ResizeBuffer(byte[] bytes)
+ private static byte[] ResizeBuffer(byte[] oldArray)
{
- var length = (uint)bytes.Length * 2;
- if (length > (uint)Array.MaxLength)
- length = (uint)Math.Max(Array.MaxLength, bytes.Length + 1);
+ var length = oldArray.Length * 2;
+ if ((uint)length > (uint)Array.MaxLength)
+ length = Math.Max(Array.MaxLength, oldArray.Length + 1);
- var tmp = ArrayPool.Shared.Rent((int)length);
- Buffer.BlockCopy(bytes, 0, tmp, 0, bytes.Length);
+ var newArray = ArrayPool.Shared.Rent(length);
- var rented = bytes;
- bytes = tmp;
+ Debug.Assert(oldArray.Length <= newArray.Length);
+ oldArray.AsSpan().TryCopyTo(newArray);
- ArrayPool.Shared.Return(rented);
- return bytes;
+ ArrayPool.Shared.Return(oldArray);
+ return newArray;
}
private static long GetStreamLength(Stream stream)
diff --git a/src/Ramstack.FileProviders.Extensions/FileNode.cs b/src/Ramstack.FileProviders.Extensions/FileNode.cs
index adf3c4f..cb19b80 100644
--- a/src/Ramstack.FileProviders.Extensions/FileNode.cs
+++ b/src/Ramstack.FileProviders.Extensions/FileNode.cs
@@ -28,7 +28,7 @@ public sealed class FileNode : FileNodeBase
public DateTimeOffset LastWriteTime => _file.LastModified;
///
- /// Gets an instance representing the parent directory.
+ /// Gets a instance representing the parent directory.
///
public DirectoryNode Directory
{
diff --git a/src/Ramstack.FileProviders.Extensions/FileNodeExtensions.cs b/src/Ramstack.FileProviders.Extensions/FileNodeExtensions.cs
index 9704702..bc8efd0 100644
--- a/src/Ramstack.FileProviders.Extensions/FileNodeExtensions.cs
+++ b/src/Ramstack.FileProviders.Extensions/FileNodeExtensions.cs
@@ -40,7 +40,7 @@ public static byte[] ReadAllBytes(this FileNode file) =>
file.ToFileInfo().ReadAllBytes();
///
- /// Asynchronously reads all the text in the current file with the specified encoding.
+ /// Asynchronously reads all the text in the current file.
///
/// The file from which to read the entire text content.
/// An optional cancellation token to cancel the operation.
diff --git a/src/Ramstack.FileProviders.Extensions/FilePath.cs b/src/Ramstack.FileProviders.Extensions/FilePath.cs
index ee299fc..c6031e4 100644
--- a/src/Ramstack.FileProviders.Extensions/FilePath.cs
+++ b/src/Ramstack.FileProviders.Extensions/FilePath.cs
@@ -156,11 +156,11 @@ public static ReadOnlySpan GetDirectoryName(ReadOnlySpan path)
}
///
- /// Determines if the specified path in a normalized form.
+ /// Determines whether the specified path is in a normalized form.
///
/// The path to test.
///
- /// if the path in a normalized form;
+ /// if the path is in a normalized form;
/// otherwise, .
///
public static bool IsNormalized(ReadOnlySpan path)
diff --git a/src/Ramstack.FileProviders.Extensions/FileProviderExtensions.Enumeration.cs b/src/Ramstack.FileProviders.Extensions/FileProviderExtensions.Enumeration.cs
index 30ed0b9..e42ab74 100644
--- a/src/Ramstack.FileProviders.Extensions/FileProviderExtensions.Enumeration.cs
+++ b/src/Ramstack.FileProviders.Extensions/FileProviderExtensions.Enumeration.cs
@@ -68,7 +68,7 @@ public static IEnumerable EnumerateFileNodes(this IFileProvider pr
///
/// -
///
- /// Brace patterns are supported, including nested brace pattern:
+ /// Brace patterns are supported, including nested brace patterns:
/// {file,dir,name}, {file-1.{c,cpp},file-2.{cs,f}}
///
///
@@ -129,7 +129,7 @@ public static IEnumerable EnumerateFiles(this IFileProvider provider,
///
/// -
///
- /// Brace patterns are supported, including nested brace pattern:
+ /// Brace patterns are supported, including nested brace patterns:
/// {file,dir,name}, {file-1.{c,cpp},file-2.{cs,f}}
///
///
@@ -190,7 +190,7 @@ public static IEnumerable EnumerateFiles(this IFileProvider provider,
///
/// -
///
- /// Brace patterns are supported, including nested brace pattern:
+ /// Brace patterns are supported, including nested brace patterns:
/// {file,dir,name}, {file-1.{c,cpp},file-2.{cs,f}}
///
///
@@ -251,7 +251,7 @@ public static IEnumerable EnumerateDirectories(this IFileProvider
///
/// -
///
- /// Brace patterns are supported, including nested brace pattern:
+ /// Brace patterns are supported, including nested brace patterns:
/// {file,dir,name}, {file-1.{c,cpp},file-2.{cs,f}}
///
///
@@ -312,7 +312,7 @@ public static IEnumerable EnumerateDirectories(this IFileProvider
///
/// -
///
- /// Brace patterns are supported, including nested brace pattern:
+ /// Brace patterns are supported, including nested brace patterns:
/// {file,dir,name}, {file-1.{c,cpp},file-2.{cs,f}}
///
///
@@ -341,7 +341,7 @@ public static IEnumerable EnumerateFileNodes(this IFileProvider pr
provider.GetDirectory(path).EnumerateFileNodes(pattern, exclude);
///
- /// Returns an enumerable collection of file nodes in the specified directory that match any of the provided glob patterns.
+ /// Returns an enumerable collection of file nodes in the specified directory that match any of the given glob patterns.
///
/// The file provider to use.
/// The path of the directory from which to retrieve file nodes.
@@ -373,7 +373,7 @@ public static IEnumerable EnumerateFileNodes(this IFileProvider pr
///
/// -
///
- /// Brace patterns are supported, including nested brace pattern:
+ /// Brace patterns are supported, including nested brace patterns:
/// {file,dir,name}, {file-1.{c,cpp},file-2.{cs,f}}
///
///
diff --git a/src/Ramstack.FileProviders.Extensions/FileProviderExtensions.cs b/src/Ramstack.FileProviders.Extensions/FileProviderExtensions.cs
index 36e9049..6377474 100644
--- a/src/Ramstack.FileProviders.Extensions/FileProviderExtensions.cs
+++ b/src/Ramstack.FileProviders.Extensions/FileProviderExtensions.cs
@@ -8,12 +8,12 @@ namespace Ramstack.FileProviders;
public static partial class FileProviderExtensions
{
///
- /// Returns file contents as readonly stream.
+ /// Returns file contents as a read-only stream.
///
/// The .
/// The path of the file to open.
///
- /// The file contents as readonly stream.
+ /// The file contents as a read-only stream.
///
public static Stream OpenRead(this IFileProvider provider, string path) =>
provider.GetFileInfo(path).OpenRead();
@@ -66,7 +66,7 @@ public static byte[] ReadAllBytes(this IFileProvider provider, string path) =>
provider.GetFileInfo(path).ReadAllBytes();
///
- /// Asynchronously reads all the text in the current file with the specified encoding.
+ /// Asynchronously reads all the text in the current file.
///
/// The .
/// The path of the file to read from.
diff --git a/src/Ramstack.FileProviders.Globbing/GlobbingFileProvider.cs b/src/Ramstack.FileProviders.Globbing/GlobbingFileProvider.cs
index 89f8986..74a4b89 100644
--- a/src/Ramstack.FileProviders.Globbing/GlobbingFileProvider.cs
+++ b/src/Ramstack.FileProviders.Globbing/GlobbingFileProvider.cs
@@ -7,7 +7,7 @@ namespace Ramstack.FileProviders;
///
///
/// The class wraps around another and applies glob-based
-/// filtering rules to determine, which files to include or exclude. This allows for flexible and powerful file selection
+/// filtering rules to determine which files to include or exclude. This allows for flexible and powerful file selection
/// using standard glob patterns.
///
///
diff --git a/src/Ramstack.FileProviders.Globbing/Internal/PathHelper.cs b/src/Ramstack.FileProviders.Globbing/Internal/PathHelper.cs
index c6fd6c5..0a9c116 100644
--- a/src/Ramstack.FileProviders.Globbing/Internal/PathHelper.cs
+++ b/src/Ramstack.FileProviders.Globbing/Internal/PathHelper.cs
@@ -17,7 +17,7 @@ internal static class PathHelper
///
/// Determines whether the specified path matches any of the specified patterns.
///
- /// The path to match for a match.
+ /// The path to check for a match.
/// An array of patterns to match against the path.
///
/// if the path matches any of the patterns;