Fix StreamShims Read method to not call itself.

This commit is contained in:
Ray 2021-09-12 12:30:17 +02:00
parent 03095916f1
commit 6cba058138

View File

@ -22,7 +22,7 @@ namespace System.IO
public static int Read(this Stream stream, Span<byte> buffer)
{
byte[] bytes = new byte[buffer.Length];
int bytesRead = stream.Read(bytes);
int bytesRead = stream.Read(bytes, 0, bytes.Length);
bytes.AsSpan(0, bytesRead).CopyTo(buffer);
return bytesRead;
}