Skip to content

RentedMemoryStream.FromMemory method (1 of 2)

public static MemoryStream FromMemory(IMemoryOwner<byte> owner, bool writable = false, 
    bool exposed = false)

See Also


RentedMemoryStream.FromMemory method (2 of 2)

Attempts to create a RentedMemoryStream with the owner and backing array of the !:ReadOnlyMemory<byte>. If that fails copies the memory and disposes the owner returning a MemoryStream; otherwise returns RentedMemoryStream, which disposed the owner when disposed itself.

public static MemoryStream FromMemory(IDisposable owner, ReadOnlyMemory<byte> memory, 
    bool writable = false, bool exposed = false)

See Also