# WriteArrayElementBoundsChecked<T>(void*, int, T, int)

> Writes an element to a buffer after bounds checking.

## Definition

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

```csharp
public static void WriteArrayElementBoundsChecked<T>(void* destination, int index, T value, int capacity) where T : unmanaged
```

### Parameters

**** (\[void\*]\(https\://learn.microsoft.com/dotnet/api/system.void)): The buffer to write to.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The index at which to store the element.**** (T): The value to write.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The buffer capacity (in number of elements). Used for the bounds checking.
