# NativeArrayUnsafeUtility

> Contains unsafe methods for working with NativeArray instances.

## Definition

* **Type:** Class
* **Namespace:** [Unity.Collections.LowLevel.Unsafe](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe.md)
* **Assembly:** UnityEngine.ManagedKernelModule

```csharp
public static class NativeArrayUnsafeUtility
```

## Remarks

This class contains methods that you can use to perform unsafe operations that ignore the job safety system. For example, if you are implementing your own [custom native container](/engine/6000.7/manual/scripting/optimization/job-system/thread-safe-types/custom-nativecontainer.md), you might want to call `NativeArray` methods that cause the safety system to produce errors, even though you're implementing these methods safely. `NativeArrayUnsafeUtility` allows you to perform these operations without triggering errors in the safety system.

## Static Methods

| Method                                                                                                                                                                   | Description                                                                                                                                                                                                                              |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [ConvertExistingDataToNativeArray](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/nativearrayunsafeutility/convertexistingdatatonativearray.md)       | Converts a buffer to a NativeArray.                                                                                                                                                                                                      |
| [GetAtomicSafetyHandle](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/nativearrayunsafeutility/getatomicsafetyhandle.md)                             | Gets the [AtomicSafetyHandle](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/atomicsafetyhandle.md) that is used for safety control on a NativeArray.                                                                 |
| [GetUnsafeBufferPointerWithoutChecks](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/nativearrayunsafeutility/getunsafebufferpointerwithoutchecks.md) | Gets the pointer to the data owner of a [NativeArray\<T>](/engine/6000.7/script-reference/unity/collections/nativearray1.md), without performing checks.                                                                                 |
| [GetUnsafePtr](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/nativearrayunsafeutility/getunsafeptr.md)                                               | Gets the pointer to the memory buffer owner of a , and checks whether there is write access to the NativeArray. If there is no write access to the NativeArray, an InvalidOperationException is thrown.                                  |
| [GetUnsafeReadOnlyPtr](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/nativearrayunsafeutility/getunsafereadonlyptr.md)                               | Gets a pointer to the memory buffer of a [NativeArray\<T>](/engine/6000.7/script-reference/unity/collections/nativearray1.md) or [NativeArray\<T>.ReadOnly](/engine/6000.7/script-reference/unity/collections/nativearray1/readonly.md). |
| [SetAtomicSafetyHandle](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/nativearrayunsafeutility/setatomicsafetyhandle.md)                             | Sets a new [AtomicSafetyHandle](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/atomicsafetyhandle.md) on a [NativeArray\<T>](/engine/6000.7/script-reference/unity/collections/nativearray1.md).                      |
