Patrik Svensson 54be64ec84
Add JSON text renderer (#1086)
* Add JsonText widget to render highlighted JSON

Closes #1051
2022-12-31 18:17:15 +00:00

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();
}
}
}