I just released a new NuGet package, Marvin.StreamExtensions. It contains a set of helper extension methods (on Stream) for working with streams which I find particularly useful for interacting with an API through HttpClient.
Working with streams when interacting with an API has the advantage of lowering your memory footprint and potentially improves performance as well, yet it’s quite a lot of code to write, especially once you start using streams for both input (sending data) and output (reading data from a response). These methods help with that.
There’s 24 extension methods in total (sync & async where it makes sense, generic & non-generic) in this initial release. Examples: