1
0
Fork 0
WordpressEbookScraper2/Scraper/Extensions.cs

21 lines
470 B
C#

namespace WordpressEboobScraper2.Scraper;
public static class Extensions
{
public static void Dump(this string str)
{
Console.Out.WriteLine(str);
}
public static byte[] ReadAllToByteArray(this Stream stream)
{
var bytes = new List<byte>();
int b;
// -1 is a special value that mark the end of the stream
while ((b = stream.ReadByte()) != -1) bytes.Add((byte)b);
return bytes.ToArray();
}
}