mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Buffered fix
This commit is contained in:
parent
3756323021
commit
1cb5538317
1 changed files with 2 additions and 0 deletions
|
@ -69,6 +69,8 @@ namespace System.IO
|
||||||
public override Result<int> TryRead(Span<uint8> data)
|
public override Result<int> TryRead(Span<uint8> data)
|
||||||
{
|
{
|
||||||
int spaceLeft = (.)(mBufferEnd - mPos);
|
int spaceLeft = (.)(mBufferEnd - mPos);
|
||||||
|
if (mPos < mBufferPos)
|
||||||
|
spaceLeft = 0;
|
||||||
if (data.Length <= spaceLeft)
|
if (data.Length <= spaceLeft)
|
||||||
{
|
{
|
||||||
Internal.MemCpy(data.Ptr, mBuffer.Ptr + (mPos - mBufferPos), data.Length);
|
Internal.MemCpy(data.Ptr, mBuffer.Ptr + (mPos - mBufferPos), data.Length);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue