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.

C#
[System.CLSCompliant(false)]
public static Windows.Storage.Streams.IBuffer GetWindowsRuntimeBuffer(this System.IO.MemoryStream underlyingStream);

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

Applies to

UWP 10.0
Produkt Versioner
UWP 10.0

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.

C#
[System.CLSCompliant(false)]
public static Windows.Storage.Streams.IBuffer GetWindowsRuntimeBuffer(this System.IO.MemoryStream underlyingStream, int positionInStream, int length);

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

UWP 10.0
Produkt Versioner
UWP 10.0