Gemstone Threading Library
Show/Hide TOC

# PriorityQueue T CopyTo Method

Copies the PriorityQueueT elements to an existing one-dimensional Array, starting at the specified array index.

## Definition

Namespace: Gemstone.Threading.Collections
Assembly: Gemstone.Threading (in Gemstone.Threading.dll) Version: 1.0.159 -- Release Build+94b67ea5187267d7edb4458b634b6580ba7dbb78
C#
View Source Request Example

    public void CopyTo(
    	T[] array,
    	int index
    )

VB
View Source Request Example

    Public Sub CopyTo (
    	array As T(),
    	index As Integer
    )

C++
View Source Request Example

    public:
    virtual void CopyTo(
    	array<T>^ array,
    	int index
    ) sealed

JavaScript
View Source Request Example

    function CopyTo(array, index);

#### Parameters

array T
  The one-dimensional Array that is the destination of the elements copied from the PriorityQueueT. The Array must have zero-based indexing.
index Int32
  The zero-based index in array at which copying begins.

#### Implements

IProducerConsumerCollectionT CopyTo(T, Int32)

## Exceptions

ArgumentNullException | array is a null reference (Nothing in Visual Basic).
ArgumentOutOfRangeException | index is less than zero.
ArgumentException | index is equal to or greater than the length of the array -or- The number of elements in the source PriorityQueueT is greater than the available space from index to the end of the destination array.

## See Also

#### Reference

PriorityQueueT Class
Gemstone.Threading.Collections Namespace