mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-16 00:42:51 +08:00
18 lines
364 B
C#
18 lines
364 B
C#
namespace Spectre.Console.Tests;
|
|
|
|
public static class StreamExtensions
|
|
{
|
|
public static string ReadText(this Stream stream)
|
|
{
|
|
if (stream is null)
|
|
{
|
|
throw new ArgumentNullException(nameof(stream));
|
|
}
|
|
|
|
using (var reader = new StreamReader(stream))
|
|
{
|
|
return reader.ReadToEnd();
|
|
}
|
|
}
|
|
}
|