React to API changes in System.Text.Primitives

This commit is contained in:
Nate McMaster 2017-02-15 11:52:56 -08:00
parent f684fcb574
commit 92b3cb1592
1 changed files with 3 additions and 3 deletions

View File

@ -59,7 +59,7 @@ namespace Microsoft.AspNetCore.Sockets
// Encode the payload. For now, we make it an array and use the old-fashioned types because we need to mirror packages
// I've filed https://github.com/aspnet/SignalR/issues/192 to update this. -anurse
var payload = Convert.ToBase64String(message.Payload.Buffer.ToArray());
if (!TextEncoder.Utf8.TryEncodeString(payload, buffer, out int payloadWritten))
if (!TextEncoder.Utf8.TryEncode(payload, buffer, out int payloadWritten))
{
bytesWritten = 0;
return false;
@ -106,7 +106,7 @@ namespace Microsoft.AspNetCore.Sockets
buffer = buffer.Slice(colonIndex);
// Parse the length
if (!PrimitiveParser.TryParseInt32(lengthSpan, out var length, out var consumedByLength, EncodingData.InvariantUtf8) || consumedByLength < lengthSpan.Length)
if (!PrimitiveParser.TryParseInt32(lengthSpan, out var length, out var consumedByLength, encoding: EncodingData.InvariantUtf8) || consumedByLength < lengthSpan.Length)
{
message = default(Message);
bytesConsumed = 0;
@ -245,4 +245,4 @@ namespace Microsoft.AspNetCore.Sockets
}
}
}
}
}