We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 44c65e9 commit 55dbe85Copy full SHA for 55dbe85
src/Microsoft.IdentityModel.Tokens/Json/JsonSerializerPrimitives.cs
@@ -89,7 +89,7 @@ public static JsonElement CreateJsonElement(IList<string> strings)
89
writer.WriteEndArray();
90
writer.Flush();
91
92
- Utf8JsonReader reader = new(memoryStream.ToArray());
+ Utf8JsonReader reader = new(memoryStream.GetBuffer().AsSpan(0, (int)memoryStream.Length));
93
94
#if NET6_0_OR_GREATER
95
bool ret = JsonElement.TryParseValue(ref reader, out JsonElement? jsonElement);
0 commit comments