# BinaryWriter

> An interface that writes primitive types to a binary buffer.

## Definition

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

```csharp
public interface BinaryWriter : IDisposable
```

## Remarks

Additional Resources: [MemoryBinaryWriter](/engine/7000.0/script-reference/unity/entities/serialization/memorybinarywriter.md)

## Properties

| Property                                                                                          | Description                                                  |
| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| [Position](/engine/7000.0/script-reference/unity/entities/serialization/binarywriter/position.md) | Gets or sets the current write position of the BinaryWriter. |

## Methods

| Method                                                                                                | Description                           |
| ----------------------------------------------------------------------------------------------------- | ------------------------------------- |
| [WriteBytes](/engine/7000.0/script-reference/unity/entities/serialization/binarywriter/writebytes.md) | Writes the specified number of bytes. |

## Inheritance

**Inherited Members:**

* [IDisposable.Dispose()](https://learn.microsoft.com/dotnet/api/system.idisposable.dispose)
