A custom HttpContent that wraps a rented byte array from an ArrayPool, writes only the valid byte range to outgoing streams, and returns the buffer to the pool when disposed to reduce GC allocations.
$ dotnet add package Soenneker.HttpContents.PooledByteArrays
Soenneker.HttpContents.PooledByteArraysdotnet add package Soenneker.HttpContents.PooledByteArrays