In ASP.NET one has three options (that I know of) for writing directly to the response buffer.
Given the following data:
var str = "Hello World";
var bytes = Encoding.UTF8.GetBytes(str);
We can write to the response buffer using:
// method 1
await HttpResponse.WriteAsync(str);
// method 2
await HttpResponse.Body.WriteAsync(bytes);
// method 3
await HttpResponse.BodyWriter.WriteAsync(bytes);
What are the differences between them, if any?