# ReadNext

> Reads an element from the append buffer.

## Definition

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

## ReadNext\<T>(T)

Reads an element from the append buffer.

```csharp
public void ReadNext<T>(out T value) where T : unmanaged
```

### Parameters

**** (T): Output for the element read.

### Remarks

Advances the reader's offset by the size of T.

## ReadNext\<T>()

Reads an element from the append buffer.

```csharp
public T ReadNext<T>() where T : unmanaged
```

### Returns

| Type | Description       |
| ---- | ----------------- |
| T    | The element read. |

### Remarks

Advances the reader's offset by the size of T.

## ReadNext(int)

Reads an element from the append buffer.

```csharp
public void* ReadNext(int structSize)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The size of the element to read.

### Returns

| Type                                                         | Description                                                       |
| ------------------------------------------------------------ | ----------------------------------------------------------------- |
| [void\*](https://learn.microsoft.com/dotnet/api/system.void) | A pointer to where the read element resides in the append buffer. |

### Remarks

Advances the reader's offset by `structSize`.

## ReadNext\<T>(NativeArray\<T>, AllocatorHandle)

Reads an element from the append buffer.

```csharp
public void ReadNext<T>(out NativeArray<T> value, AllocatorManager.AllocatorHandle allocator) where T : unmanaged
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.7/script-reference/unity/collections/nativearray1)): Outputs a new array with length of 1. The read element is copied to the single index of this array.**** (\[AllocatorHandle]\(/engine/6000.7/script-reference/unity/collections/allocatormanager/allocatorhandle)): The allocator to use.

### Remarks

Advances the reader's offset by the size of T.
