# Copy

> Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Collections](/engine/6000.7/script-reference/unity/collections.md)
* **Assembly:** UnityEngine.ManagedKernelModule

## Copy(NativeArray\<T>, NativeArray\<T>)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.

```csharp
public static void Copy(NativeArray<T> src, NativeArray<T> dst)
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.7/script-reference/unity/collections/nativearray1)): The data to copy.**** (\[NativeArray\<T>]\(/engine/6000.7/script-reference/unity/collections/nativearray1)): The array that receives the data.

## Copy(ReadOnly, NativeArray\<T>)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.

```csharp
public static void Copy(NativeArray<T>.ReadOnly src, NativeArray<T> dst)
```

### Parameters

**** (\[ReadOnly]\(/engine/6000.7/script-reference/unity/collections/nativearray1/readonly)): The data to copy.**** (\[NativeArray\<T>]\(/engine/6000.7/script-reference/unity/collections/nativearray1)): The array that receives the data.

## Copy(\`0\[], NativeArray\<T>)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.

```csharp
public static void Copy(T[] src, NativeArray<T> dst)
```

### Parameters

**** (\[\<T>\[]]\(./)): The data to copy.**** (\[NativeArray\<T>]\(/engine/6000.7/script-reference/unity/collections/nativearray1)): The array that receives the data.

## Copy(NativeArray\<T>, \`0\[])

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.

```csharp
public static void Copy(NativeArray<T> src, T[] dst)
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.7/script-reference/unity/collections/nativearray1)): The data to copy.**** (\[\<T>\[]]\(./)): The array that receives the data.

## Copy(ReadOnly, \`0\[])

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.

```csharp
public static void Copy(NativeArray<T>.ReadOnly src, T[] dst)
```

### Parameters

**** (\[ReadOnly]\(/engine/6000.7/script-reference/unity/collections/nativearray1/readonly)): The data to copy.**** (\[\<T>\[]]\(./)): The array that receives the data.

## Copy(NativeArray\<T>, NativeArray\<T>, int)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.

```csharp
public static void Copy(NativeArray<T> src, NativeArray<T> dst, int length)
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.7/script-reference/unity/collections/nativearray1)): The data to copy.**** (\[NativeArray\<T>]\(/engine/6000.7/script-reference/unity/collections/nativearray1)): The array that receives the data.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A 32-bit integer that represents the number of elements to copy. The integer must be equal to or greater than zero.

## Copy(ReadOnly, NativeArray\<T>, int)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.

```csharp
public static void Copy(NativeArray<T>.ReadOnly src, NativeArray<T> dst, int length)
```

### Parameters

**** (\[ReadOnly]\(/engine/6000.7/script-reference/unity/collections/nativearray1/readonly)): The data to copy.**** (\[NativeArray\<T>]\(/engine/6000.7/script-reference/unity/collections/nativearray1)): The array that receives the data.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)):&#x20;

## Copy(\`0\[], NativeArray\<T>, int)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.

```csharp
public static void Copy(T[] src, NativeArray<T> dst, int length)
```

### Parameters

**** (\[\<T>\[]]\(./)): The data to copy.**** (\[NativeArray\<T>]\(/engine/6000.7/script-reference/unity/collections/nativearray1)): The array that receives the data.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A 32-bit integer that represents the number of elements to copy. The integer must be equal to or greater than zero.

## Copy(NativeArray\<T>, \`0\[], int)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.

```csharp
public static void Copy(NativeArray<T> src, T[] dst, int length)
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.7/script-reference/unity/collections/nativearray1)): The data to copy.**** (\[\<T>\[]]\(./)): The array that receives the data.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A 32-bit integer that represents the number of elements to copy. The integer must be equal to or greater than zero.

## Copy(ReadOnly, \`0\[], int)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.

```csharp
public static void Copy(NativeArray<T>.ReadOnly src, T[] dst, int length)
```

### Parameters

**** (\[ReadOnly]\(/engine/6000.7/script-reference/unity/collections/nativearray1/readonly)): The data to copy.**** (\[\<T>\[]]\(./)): The array that receives the data.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)):&#x20;

## Copy(NativeArray\<T>, int, NativeArray\<T>, int, int)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.

```csharp
public static void Copy(NativeArray<T> src, int srcIndex, NativeArray<T> dst, int dstIndex, int length)
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.7/script-reference/unity/collections/nativearray1)): The data to copy.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A 32-bit integer that represents the index in the `src` array where copying begins.**** (\[NativeArray\<T>]\(/engine/6000.7/script-reference/unity/collections/nativearray1)): The array that receives the data.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A 32-bit integer that represents the index in the `dst` array where storing begins.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A 32-bit integer that represents the number of elements to copy. The integer must be equal to or greater than zero.

## Copy(ReadOnly, int, NativeArray\<T>, int, int)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.

```csharp
public static void Copy(NativeArray<T>.ReadOnly src, int srcIndex, NativeArray<T> dst, int dstIndex, int length)
```

### Parameters

**** (\[ReadOnly]\(/engine/6000.7/script-reference/unity/collections/nativearray1/readonly)): The data to copy.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): **** (\[NativeArray\<T>]\(/engine/6000.7/script-reference/unity/collections/nativearray1)): The array that receives the data.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)):&#x20;

## Copy(\`0\[], int, NativeArray\<T>, int, int)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.

```csharp
public static void Copy(T[] src, int srcIndex, NativeArray<T> dst, int dstIndex, int length)
```

### Parameters

**** (\[\<T>\[]]\(./)): The data to copy.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A 32-bit integer that represents the index in the `src` array where copying begins.**** (\[NativeArray\<T>]\(/engine/6000.7/script-reference/unity/collections/nativearray1)): The array that receives the data.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A 32-bit integer that represents the index in the `dst` array where storing begins.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A 32-bit integer that represents the number of elements to copy. The integer must be equal to or greater than zero.

## Copy(NativeArray\<T>, int, \`0\[], int, int)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.

```csharp
public static void Copy(NativeArray<T> src, int srcIndex, T[] dst, int dstIndex, int length)
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.7/script-reference/unity/collections/nativearray1)): The data to copy.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A 32-bit integer that represents the index in the `src` array where copying begins.**** (\[\<T>\[]]\(./)): The array that receives the data.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A 32-bit integer that represents the index in the `dst` array where storing begins.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A 32-bit integer that represents the number of elements to copy. The integer must be equal to or greater than zero.

## Copy(ReadOnly, int, \`0\[], int, int)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.

```csharp
public static void Copy(NativeArray<T>.ReadOnly src, int srcIndex, T[] dst, int dstIndex, int length)
```

### Parameters

**** (\[ReadOnly]\(/engine/6000.7/script-reference/unity/collections/nativearray1/readonly)): The data to copy.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): **** (\[\<T>\[]]\(./)): The array that receives the data.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)):&#x20;
