Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netstandard2.0 #323

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
5 changes: 3 additions & 2 deletions source/NetCoreServer/Buffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,10 @@ public long Append(string text)
/// <returns>Count of append bytes</returns>
public long Append(ReadOnlySpan<char> text)
{
int length = Encoding.UTF8.GetMaxByteCount(text.Length);
var encoding = Encoding.UTF8;
var length = encoding.GetMaxByteCount(text.Length);
Reserve(_size + length);
long result = Encoding.UTF8.GetBytes(text, new Span<byte>(_data, (int)_size, length));
var result = encoding.GetBytes(text.ToArray(), 0, text.Length, _data, (int)_size);
_size += result;
return result;
}
Expand Down
Loading