WindowsRuntimeBufferExtensions.GetWindowsRuntimeBuffer Method

Definition

Overloads

GetWindowsRuntimeBuffer(MemoryStream)

Returns a Windows.Storage.Streams.IBuffer interface that represents the same memory as the specified memory stream.

GetWindowsRuntimeBuffer(MemoryStream, Int32, Int32)

Returns a Windows.Storage.Streams.IBuffer interface that represents a region within the memory that the specified memory stream represents.

GetWindowsRuntimeBuffer(MemoryStream)

Important

This API is not CLS-compliant.

Returns a Windows.Storage.Streams.IBuffer interface that represents the same memory as the specified memory stream.

public:
[System::Runtime::CompilerServices::Extension]
 static Windows::Storage::Streams::IBuffer ^ GetWindowsRuntimeBuffer(System::IO::MemoryStream ^ underlyingStream);
[System.CLSCompliant(false)]
public static Windows.Storage.Streams.IBuffer GetWindowsRuntimeBuffer (this System.IO.MemoryStream underlyingStream);
static member GetWindowsRuntimeBuffer : System.IO.MemoryStream -> Windows.Storage.Streams.IBuffer
<Extension()>
Public Function GetWindowsRuntimeBuffer (underlyingStream As MemoryStream) As IBuffer

Parameters

underlyingStream
MemoryStream

The stream that provides the backing memory for the IBuffer.

Returns

A Windows.Storage.Streams.IBuffer interface that is backed by the same memory that backs the specified memory stream.

Attributes

GetWindowsRuntimeBuffer(MemoryStream, Int32, Int32)

Important

This API is not CLS-compliant.

Returns a Windows.Storage.Streams.IBuffer interface that represents a region within the memory that the specified memory stream represents.

public:
[System::Runtime::CompilerServices::Extension]
 static Windows::Storage::Streams::IBuffer ^ GetWindowsRuntimeBuffer(System::IO::MemoryStream ^ underlyingStream, int positionInStream, int length);
[System.CLSCompliant(false)]
public static Windows.Storage.Streams.IBuffer GetWindowsRuntimeBuffer (this System.IO.MemoryStream underlyingStream, int positionInStream, int length);
static member GetWindowsRuntimeBuffer : System.IO.MemoryStream * int * int -> Windows.Storage.Streams.IBuffer
<Extension()>
Public Function GetWindowsRuntimeBuffer (underlyingStream As MemoryStream, positionInStream As Integer, length As Integer) As IBuffer

Parameters

underlyingStream
MemoryStream

The stream that shares memory with the IBuffer.

positionInStream
Int32

The position of the shared memory region in underlyingStream.

length
Int32

The maximum size of the shared memory region. If the number of bytes in underlyingStream, starting at positionInStream, is less than length, the IBuffer that is returned represents only the available bytes.

Returns

A Windows.Storage.Streams.IBuffer interface that is backed by a region within the memory that backs the specified memory stream.

Attributes

Exceptions

underlyingStream is null.

positionInStream or length is less than 0 (zero).

positionInStream is beyond the end of source.

underlyingStream cannot expose its underlying memory buffer.

underlyingStream has been closed.

Applies to