1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Buffered fix

This commit is contained in:
Brian Fiete 2021-04-12 17:22:14 -04:00
parent 3756323021
commit 1cb5538317

View file

@ -69,6 +69,8 @@ namespace System.IO
public override Result<int> TryRead(Span<uint8> data)
{
int spaceLeft = (.)(mBufferEnd - mPos);
if (mPos < mBufferPos)
spaceLeft = 0;
if (data.Length <= spaceLeft)
{
Internal.MemCpy(data.Ptr, mBuffer.Ptr + (mPos - mBufferPos), data.Length);