Update StreamDataReader.ReadString to remove null character

This commit is contained in:
miku-666
2023-01-13 17:23:47 +01:00
parent 428665d23b
commit 01f21f4442

View File

@@ -39,7 +39,7 @@ namespace PckStudio.Classes.IO
protected static string ReadString(Stream stream, int length, Encoding encoding)
{
byte[] buffer = ReadBytes(stream, length << Convert.ToInt32(encoding is UnicodeEncoding));
return encoding.GetString(buffer);
return encoding.GetString(buffer).TrimEnd('\0');
}
protected static byte[] ReadBytes(Stream stream, int count)