# ValueSerializer&lt;T&gt;.Serialize(T, Stream, SerializerSession, int)

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

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

```csharp
public void Serialize(scoped ref T value, Stream destination, SerializerSession session, int sizeHint = 0)
```

Serializes the provided `value` into `destination`.

### Parameters

- `value` (`T`): The value to serialize.
- `destination` (`Stream`): The destination where serialized data will be written.
- `session` (`SerializerSession`): The serializer session.
- `sizeHint` (`int`): The estimated upper bound for the length of the serialized data.
