# ToNativeArray<T>(AllocatorHandle)

> Returns a new NativeArray copy of this stream's data.

## Definition

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

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

### Parameters

**** (\[AllocatorHandle]\(/engine/6000.7/script-reference/unity/collections/allocatormanager/allocatorhandle)): The allocator to use.

### Returns

| Type                                                                                 | Description                                   |
| ------------------------------------------------------------------------------------ | --------------------------------------------- |
| [NativeArray\<T>](/engine/6000.7/script-reference/unity/collections/nativearray1.md) | A new NativeArray copy of this stream's data. |

### Remarks

The length of the array will equal the count of this stream.

Each buffer of this stream is copied to the array, one after the other.
