# CopyFrom

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

## Definition

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

## CopyFrom(NativeSlice\<T>)

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

```csharp
public void CopyFrom(NativeSlice<T> slice)
```

### Parameters

**** (\[NativeSlice\<T>]\(/engine/6000.6/script-reference/unity/collections/nativeslice1)): The [NativeSlice\<T>](/engine/6000.6/script-reference/unity/collections/nativeslice1.md) to copy the elements from.

## CopyFrom(\`0\[])

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

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

### Parameters

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