# ConvertExistingDataToNativeArray<T>(void*, int, AllocatorHandle, bool)

> Convert existing data into a NativeArray.

## Definition

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

```csharp
public static NativeArray<T> ConvertExistingDataToNativeArray<T>(void* dataPointer, int length, AllocatorManager.AllocatorHandle allocator, bool setTempMemoryHandle = false) where T : unmanaged
```

### Parameters

**** (\[void\*]\(https\://learn.microsoft.com/dotnet/api/system.void)): Pointer to the data to be converted.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The count of elements.**** (\[AllocatorHandle]\(/engine/6000.7/script-reference/unity/collections/allocatormanager/allocatorhandle)): The Allocator to use.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Use temporary memory atomic safety handle.

### Returns

| Type                                                                                 | Description                               |
| ------------------------------------------------------------------------------------ | ----------------------------------------- |
| [NativeArray\<T>](/engine/6000.7/script-reference/unity/collections/nativearray1.md) | Returns the NativeArray that was created. |

### Remarks

The caller is still the owner of the data.
