# CopyFrom

> Copies all the elements from a NativeArray<T> or a managed array of the same length.

## Definition

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

## CopyFrom(\`0\[])

Copies all the elements from a [NativeArray\<T>](/engine/6000.6/script-reference/unity/collections/nativearray1.md) or a managed array of the same length.

```csharp
public void CopyFrom(T[] array)
```

### Parameters

**** (\[\<T>\[]]\(./)): The array to copy elements from.

## CopyFrom(NativeArray\<T>)

Copies all the elements from a [NativeArray\<T>](/engine/6000.6/script-reference/unity/collections/nativearray1.md) or a managed array of the same length.

```csharp
public void CopyFrom(NativeArray<T> array)
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.6/script-reference/unity/collections/nativearray1)): The array to copy elements from.
