# Serializer&lt;T&gt;.Serialize(T, byte[])

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.serializer-1/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.serializer-1/methods/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Serializer.cs)

```csharp
public int Serialize(T value, byte[] destination)
```

Serializes the provided `value` into `destination`.

### Parameters

- `value` (`T`): The value to serialize.
- `destination` (`byte[]`): The destination where serialized data will be written.

### Returns

The length of the serialized data.
