ConcurrentQueue<T>.CopyTo(T[], Int32) Método

Definição

Copia os elementos ConcurrentQueue<T> em um Array unidimensional existente, começando no índice da matriz especificado.Copies the ConcurrentQueue<T> elements to an existing one-dimensional Array, starting at the specified array index.

public:
 virtual void CopyTo(cli::array <T> ^ array, int index);
public void CopyTo (T[] array, int index);
abstract member CopyTo : 'T[] * int -> unit
override this.CopyTo : 'T[] * int -> unit
Public Sub CopyTo (array As T(), index As Integer)

Parâmetros

array
T[]

Um Array unidimensional que é o destino dos elementos copiados do ConcurrentQueue<T>.The one-dimensional Array that is the destination of the elements copied from the ConcurrentQueue<T>. O Array deve ter indexação com base em zero.The Array must have zero-based indexing.

index
Int32

O índice com base em zero em array no qual a cópia começa.The zero-based index in array at which copying begins.

Implementações

Exceções

array é uma referência nula (Nada no Visual Basic).array is a null reference (Nothing in Visual Basic).

index é menor que zero.index is less than zero.

index é igual ou maior que o tamanho do array -ou- O número de elementos no ConcurrentQueue<T> de origem é maior que o espaço disponível do index até o fim da array de destino.index is equal to or greater than the length of the array -or- The number of elements in the source ConcurrentQueue<T> is greater than the available space from index to the end of the destination array.

Aplica-se a