# ToNativeArray(AllocatorHandle)

> Copies the buffer into a new native array.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule

```csharp
public NativeArray<T> ToNativeArray(AllocatorManager.AllocatorHandle allocator)
```

### Parameters

**** (\[AllocatorHandle]\(/engine/7000.0/script-reference/unity/collections/allocatormanager/allocatorhandle)): The type of memory allocation to use when creating the native array.

### Returns

| Type                                                                                 | Description                                              |
| ------------------------------------------------------------------------------------ | -------------------------------------------------------- |
| [NativeArray\<T>](/engine/7000.0/script-reference/unity/collections/nativearray1.md) | A native array containing copies of the buffer elements. |
