WindowsRuntimeBuffer.Create Método

Definição

Sobrecargas

Create(Int32)

Retorna uma interface Windows.Storage.Streams.IBuffer vazia que tem a capacidade máxima especificada.Returns an empty Windows.Storage.Streams.IBuffer interface that has the specified maximum capacity.

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

Retorna uma interface Windows.Storage.Streams.IBuffer que contém um intervalo de bytes especificado copiado de uma matriz de bytes.Returns a Windows.Storage.Streams.IBuffer interface that contains a specified range of bytes copied from a byte array. Se a capacidade especificada for maior que o número de bytes copiados, o restante do buffer será preenchido com zero.If the specified capacity is greater than the number of bytes copied, the rest of the buffer is zero-filled.

Create(Int32)

Importante

Esta API não está em conformidade com CLS.

Retorna uma interface Windows.Storage.Streams.IBuffer vazia que tem a capacidade máxima especificada.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

Parâmetros

capacity
Int32

O número máximo de bytes que o buffer pode conter.The maximum number of bytes the buffer can hold.

Retornos

IBuffer

Uma interface Windows.Storage.Streams.IBuffer que tem a capacidade especificada e uma propriedade Length igual a 0 (zero).A Windows.Storage.Streams.IBuffer interface that has the specified capacity and a Length property equal to 0 (zero).

Atributos

Exceções

capacity é menor que 0 (zero).capacity is less than 0 (zero).

Aplica-se a

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

Importante

Esta API não está em conformidade com CLS.

Retorna uma interface Windows.Storage.Streams.IBuffer que contém um intervalo de bytes especificado copiado de uma matriz de bytes.Returns a Windows.Storage.Streams.IBuffer interface that contains a specified range of bytes copied from a byte array. Se a capacidade especificada for maior que o número de bytes copiados, o restante do buffer será preenchido com zero.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

Parâmetros

data
Byte[]

A matriz de bytes da qual copiar.The byte array to copy from.

offset
Int32

O deslocamento em data do qual a cópia começa.The offset in data from which copying begins.

length
Int32

O número de bytes a serem copiados.The number of bytes to copy.

capacity
Int32

O número máximo de bytes que o buffer pode conter; se for maior que length, o restante dos bytes no buffer será inicializado como 0 (zero).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).

Retornos

IBuffer

Uma interface Windows.Storage.Streams.IBuffer que contém o intervalo de bytes especificado.A Windows.Storage.Streams.IBuffer interface that contains the specified range of bytes. Se capacity for maior que length, o restante do buffer será preenchido com zero.If capacity is greater than length, the rest of the buffer is zero-filled.

Atributos

Exceções

capacity, offset ou length é menor que 0 (zero).capacity, offset, or length is less than 0 (zero).

data é nulo.data is null.

Começando em offset, data não contém elementos length.Starting at offset, data does not contain length elements. Ou então, começando em offset, data não contém elementos capacity.-or-Starting at offset, data does not contain capacity elements.

Aplica-se a