# EndWrite<T>(int)

> Ends a write operation to the buffer

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public void EndWrite<T>(int countWritten) where T : struct
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Number of elements written to the buffer. Counted from the first element.

### Remarks

This call ends a write operation on the buffer. When you call this method, Unity marks the native array returned by the corresponding [ComputeBuffer.BeginWrite](/engine/6000.7/script-reference/unityengine/computebuffer/beginwrite.md) call as unusable, and then disposes of it.
