# GetBuffer

> Gets the dynamic buffer of an entity.

## Definition

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

## GetBuffer\<T>(Entity, bool)

Gets the dynamic buffer of an entity.

```csharp
public DynamicBuffer<T> GetBuffer<T>(Entity entity, bool isReadOnly = false) where T : unmanaged, IBufferElementData
```

### Parameters

**** (\[Entity]\(/engine/7000.0/script-reference/unity/entities/entity)): The entity.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Specify whether the access to the component through this object is read only or read and write.

### Returns

| Type                                                                                  | Description                                                 |
| ------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| [DynamicBuffer\<T>](/engine/7000.0/script-reference/unity/entities/dynamicbuffer1.md) | The DynamicBuffer object for accessing the buffer contents. |

## GetBuffer\<T>(SystemHandle, bool)

Gets the dynamic buffer of an entity associated with a system.

```csharp
public DynamicBuffer<T> GetBuffer<T>(SystemHandle system, bool isReadOnly = false) where T : unmanaged, IBufferElementData
```

### Parameters

**** (\[SystemHandle]\(/engine/7000.0/script-reference/unity/entities/systemhandle)): The system handle.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Specify whether the access to the component through this object is read only or read and write.

### Returns

| Type                                                                                  | Description                                                 |
| ------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| [DynamicBuffer\<T>](/engine/7000.0/script-reference/unity/entities/dynamicbuffer1.md) | The DynamicBuffer object for accessing the buffer contents. |
