title: How to perform a minimal-allocation conversion of 'Memory<T>' into 'Stream'?
body: <p>There doesn't seem to exist a native way of converting a <code>Memory&lt;T&gt;</code> instance into a <code>Stream</code> in the framework. Is there a simple way to achieve this using some allocation-free approach that only uses the actual memory from the <code>Memory&lt;T&gt;</code> instance, or perhaps a way that leverages only a minimal buffer?</p>
  <p>I wasn't able to find any examples going from <code>Memory&lt;T&gt;</code> to <code>Stream</code>: only the opposite is common since there are several newer overloads on <code>Stream</code> that allow handling <code>Memory&lt;T&gt;</code> instances.</p>
  <p>It seems so intuitive that one would be able to convert from <code>Memory&lt;&gt;</code> to <code>MemoryStream</code> (due mostly to their names, admittedly) so I was a bit disappointed to find this wasn't the case.</p>
  <p>I also wasn't able to find any easy way of creating a <code>System.IO.Pipelines</code> <code>PipeReader</code> or <code>PipeWriter</code> with a <code>Memory&lt;T&gt;</code>, as those have a <code>AsStream</code> extension.</p>