Brought spec up to date, improvements to stability

This commit is contained in:
CloneTrooper1019
2020-07-12 20:19:30 -05:00
parent 7359b6efb7
commit 57fd3f8a25
29 changed files with 551 additions and 245 deletions

View File

@ -115,14 +115,18 @@ internal static class Formatting
return Math.Abs(a - b) < epsilon;
}
public static byte[] ReadBuffer(this BinaryReader reader)
{
int len = reader.ReadInt32();
return reader.ReadBytes(len);
}
public static string ReadString(this BinaryReader reader, bool useIntLength)
{
if (!useIntLength)
return reader.ReadString();
int len = reader.ReadInt32();
byte[] buffer = reader.ReadBytes(len);
byte[] buffer = reader.ReadBuffer();
return Encoding.UTF8.GetString(buffer);
}
}