Edit

Share via


WindowsRuntimeBuffer.Create Method

Definition

Overloads

Create(Int32)

Returns an empty Windows.Storage.Streams.IBuffer interface that has the specified maximum capacity.

Create(Byte[], Int32, Int32, Int32)

Returns a Windows.Storage.Streams.IBuffer interface that contains a specified range of bytes copied from a byte array. If the specified capacity is greater than the number of bytes copied, the rest of the buffer is zero-filled.

Create(Int32)

Important

This API is not CLS-compliant.

Returns an empty Windows.Storage.Streams.IBuffer interface that has the specified maximum capacity.

public:
 static Windows::Storage::Streams::IBuffer ^ Create(int capacity);
[System.CLSCompliant(false)]
public static Windows.Storage.Streams.IBuffer Create (int capacity);
[<System.CLSCompliant(false)>]
static member Create : int -> Windows.Storage.Streams.IBuffer
Public Shared Function Create (capacity As Integer) As IBuffer

Parameters

capacity
Int32

The maximum number of bytes the buffer can hold.

Returns

A Windows.Storage.Streams.IBuffer interface that has the specified capacity and a Length property equal to 0 (zero).

Attributes

Exceptions

capacity is less than 0 (zero).

Applies to

Create(Byte[], Int32, Int32, Int32)

Important

This API is not CLS-compliant.

Returns a Windows.Storage.Streams.IBuffer interface that contains a specified range of bytes copied from a byte array. If the specified capacity is greater than the number of bytes copied, the rest of the buffer is zero-filled.

public:
 static Windows::Storage::Streams::IBuffer ^ Create(cli::array <System::Byte> ^ data, int offset, int length, int capacity);
[System.CLSCompliant(false)]
public static Windows.Storage.Streams.IBuffer Create (byte[] data, int offset, int length, int capacity);
[<System.CLSCompliant(false)>]
static member Create : byte[] * int * int * int -> Windows.Storage.Streams.IBuffer
Public Shared Function Create (data As Byte(), offset As Integer, length As Integer, capacity As Integer) As IBuffer

Parameters

data
Byte[]

The byte array to copy from.

offset
Int32

The offset in data from which copying begins.

length
Int32

The number of bytes to copy.

capacity
Int32

The maximum number of bytes the buffer can hold; if this is greater than length, the rest of the bytes in the buffer are initialized to 0 (zero).

Returns

A Windows.Storage.Streams.IBuffer interface that contains the specified range of bytes. If capacity is greater than length, the rest of the buffer is zero-filled.

Attributes

Exceptions

capacity, offset, or length is less than 0 (zero).

data is null.

Starting at offset, data does not contain length elements. -or-Starting at offset, data does not contain capacity elements.

Applies to