ConcurrentQueue<T>.CopyTo(T[], Int32) 方法

定義

從指定的陣列索引處開始,複製 ConcurrentQueue<T> 項目至現有一維 Array

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)

參數

array
T[]

一維 Array,是從 ConcurrentQueue<T> 複製過來的項目之目的端。 Array 必須有以零為起始的索引。

index
Int32

array 中以零起始的索引,即開始複製的位置。

實作

例外狀況

array 是 null 參考 (在 Visual Basic 中為 Nothing)。

index 小於零。

index 等於或大於 array 的長度,或來源 ConcurrentQueue<T> 中的項目個數超過從 index 到目的 array 末尾的可用空間。

適用於

另請參閱