1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-18 16:10:26 +02:00

Fix ReadBuffer

This commit is contained in:
disarray2077 2023-05-04 23:57:58 -03:00 committed by GitHub
parent 678bdc0ba6
commit 3a4b22c6b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -441,7 +441,7 @@ namespace System.IO
bytePos = byteLen = 0;*/ bytePos = byteLen = 0;*/
} }
return mCharLen; return mCharLen - mCharPos;
} }
mByteLen += len; mByteLen += len;
@ -461,7 +461,7 @@ namespace System.IO
//Contract.Assert(byteLen >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); //Contract.Assert(byteLen >= 0, "Stream.Read returned a negative number! This is a bug in your stream class.");
if (mByteLen == 0) // We're at EOF if (mByteLen == 0) // We're at EOF
return mCharLen; return mCharLen - mCharPos;
} }
// _isBlocked == whether we read fewer bytes than we asked for. // _isBlocked == whether we read fewer bytes than we asked for.
@ -510,7 +510,7 @@ namespace System.IO
while (mCharLen == mCharPos); while (mCharLen == mCharPos);
//Console.WriteLine("ReadBuffer called. chars: "+char8Len); //Console.WriteLine("ReadBuffer called. chars: "+char8Len);
return mCharLen; return mCharLen - mCharPos;
} }
int GetChars(uint8[] byteBuffer, int byteOffset, int byteLength, char8[] char8Buffer, int char8Offset) int GetChars(uint8[] byteBuffer, int byteOffset, int byteLength, char8[] char8Buffer, int char8Offset)