Given ReadOnlyMemory Struct I want to convert the stream into a string
I have the following code:
var body = ea.Body; //ea.Body is of Type ReadOnlyMemory<byte>
var message = Encoding.UTF8.GetString(body);
Console.WriteLine(" [x] Received {0}", message);
And it gives the following error. I am using the latest C# with .NET CORE 3.1
Which is funny because I am literally copy pasting the Hello World example of a major product called RabbitMQ and it doesn't compile.
question from:https://stackoverflow.com/questions/61374796/c-sharp-convert-readonlymemorybyte-to-byte