# AddRange

> Adds all the elements from newElems to the end of the buffer, resizing as necessary.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule

## AddRange(NativeArray\<T>)

Adds all the elements from `newElems` to the end of the buffer, resizing as necessary.

```csharp
public void AddRange(NativeArray<T> newElems)
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/7000.0/script-reference/unity/collections/nativearray1)): The native array of elements to insert.

### Remarks

The buffer is resized if it has no additional capacity.

## AddRange(ReadOnlySpan\<T>)

Adds all the elements from `newElems` to the end of the buffer, resizing as necessary.

```csharp
public void AddRange(ReadOnlySpan<T> newElems)
```

### Parameters

**** (\[ReadOnlySpan\<T>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The ReadOnlySpan of elements to insert.

### Remarks

The buffer is resized if it has no additional capacity.
