Open
Description
There is an opportunity to remove memory application by replacing string with shared buffer:
textWriter.Write(Encoding.UTF8.GetString(output.WrittenMemory.Span));
can be replaced with
var messageBytes = writerBuffer.WrittenMemory.Span;
buffer = ArrayPool<char>.Shared.Rent(Encoding.UTF8.GetCharCount(messageBytes));
var charsWritten = Encoding.UTF8.GetChars(messageBytes, buffer);
textWriter.Write(buffer, 0, charsWritten);
ArrayPool<char>.Shared.Return(buffer);