fix: Fixes serializing strings in GenericPersistence (#1228)
This commit is contained in:
parent
448e5bec7b
commit
119eec6b61
1 changed files with 3 additions and 1 deletions
|
|
@ -64,7 +64,9 @@ public class BinaryFileReader : IGenericReader, IDisposable
|
|||
}
|
||||
|
||||
byte[] buffer = STArrayPool<byte>.Shared.Rent(length);
|
||||
var str = TextEncoding.GetString(buffer.AsSpan(0, length), _encoding);
|
||||
var strBuffer = buffer.AsSpan(0, length);
|
||||
_reader.Read(strBuffer);
|
||||
var str = TextEncoding.GetString(strBuffer, _encoding);
|
||||
STArrayPool<byte>.Shared.Return(buffer);
|
||||
return intern ? str.Intern() : str;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue