# CollectionCodec&lt;T&gt; Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.codecs.collectioncodec-1/)

## Deserialize(Reader&lt;TInput&gt;, Collection&lt;T&gt;) {#deserialize-1-ref-orleans-serialization-buffers-reader-tinput-system-collections-2898c822}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.codecs.collectioncodec-1/methods/deserialize-1-ref-orleans-serialization-buffers-reader-tinput-system-collections-2898c822/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Codecs/CollectionCodec.cs#L131-L161)

```csharp
public void Deserialize<TInput>(ref Reader<TInput> reader, Collection<T> value)
```

Deserializes into the provided value.

### Parameters

- `reader` (`Reader<TInput>`): The reader.
- `value` (`Collection<T>`): The value.

## ReadValue(Reader&lt;TInput&gt;, Field) {#readvalue-1-ref-orleans-serialization-buffers-reader-tinput-orleans-serializatio-38ab1b71}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.codecs.collectioncodec-1/methods/readvalue-1-ref-orleans-serialization-buffers-reader-tinput-orleans-serializatio-38ab1b71/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Codecs/CollectionCodec.cs#L54-L105)

```csharp
public Collection<T> ReadValue<TInput>(ref Reader<TInput> reader, Field field)
```

Reads a value.

### Parameters

- `reader` (`Reader<TInput>`): The reader.
- `field` (`Field`): The field.

### Returns

The value.

## Serialize(Writer&lt;TBufferWriter&gt;, Collection&lt;T&gt;) {#serialize-1-ref-orleans-serialization-buffers-writer-tbufferwriter-system-collec-965871cf}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.codecs.collectioncodec-1/methods/serialize-1-ref-orleans-serialization-buffers-writer-tbufferwriter-system-collec-965871cf/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Codecs/CollectionCodec.cs#L115-L125)

```csharp
public void Serialize<TBufferWriter>(ref Writer<TBufferWriter> writer, Collection<T> value)
```

Serializes the provided value.

### Parameters

- `writer` (`Writer<TBufferWriter>`): The writer.
- `value` (`Collection<T>`): The value.

## WriteField(Writer&lt;TBufferWriter&gt;, uint, Type, Collection&lt;T&gt;) {#writefield-1-ref-orleans-serialization-buffers-writer-tbufferwriter-uint-system-e24f9a2f}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.codecs.collectioncodec-1/methods/writefield-1-ref-orleans-serialization-buffers-writer-tbufferwriter-uint-system-e24f9a2f/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Codecs/CollectionCodec.cs#L39-L49)

```csharp
public void WriteField<TBufferWriter>(ref Writer<TBufferWriter> writer, uint fieldIdDelta, Type expectedType, Collection<T> value)
```

Writes a field.

### Parameters

- `writer` (`Writer<TBufferWriter>`): The writer.
- `fieldIdDelta` (`uint`): The field identifier delta.
- `expectedType` (`Type`): The expected type.
- `value` (`Collection<T>`): The value.
