# WriteList

> Writes data from a native list.

## Definition

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

## WriteList\<T>(BinaryWriter, NativeList\<T>)

Writes data from a native list.

```csharp
public static void WriteList<T>(this BinaryWriter writer, NativeList<T> data) where T : unmanaged
```

### Parameters

**** (\[BinaryWriter]\(/engine/7000.0/script-reference/unity/entities/serialization/binarywriter)): The BinaryReader to write to.**** (\[NativeList\<T>]\(/engine/7000.0/script-reference/unity/collections/nativelist1)): The data to write.

## WriteList\<T>(BinaryWriter, NativeList\<T>, int, int)

Writes the specified number of elements from a native list.

```csharp
public static void WriteList<T>(this BinaryWriter writer, NativeList<T> data, int index, int count) where T : unmanaged
```

### Parameters

**** (\[BinaryWriter]\(/engine/7000.0/script-reference/unity/entities/serialization/binarywriter)): The BinaryReader to write to.**** (\[NativeList\<T>]\(/engine/7000.0/script-reference/unity/collections/nativelist1)): The data to write.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The index at which to start writing from.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of elements to write.
