Only Memory Extensions. As Stream(ReadOnlyMemory<Byte>) Method
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
public static System.IO.Stream AsStream (this ReadOnlyMemory<byte> memory);
static member AsStream : ReadOnlyMemory<byte> -> System.IO.Stream
<Extension()> Public Function AsStream (memory As ReadOnlyMemory(Of Byte)) As Stream
A Stream wrapping the data within
Since this method only receives a Memory<T> instance, which does not track the lifetime of its underlying buffer, it is responsability of the caller to manage that. In particular, the caller must ensure that the target buffer is not disposed as long as the returned Stream is in use, to avoid unexpected issues.