Class TypeSerializerExtensions
Inherited Members
Namespace: Couchbase.Core.IO.Serializers
Assembly: Couchbase.NetClient.dll
Syntax
public static class TypeSerializerExtensions
Methods
| Edit this page View SourceDeserialize<T>(ITypeSerializer, byte[], int, int)
Deserializes the specified buffer into the Type T specified as a generic parameter.
Declaration
[Obsolete("Use the ReadOnlyMemory<byte> based overload of Deserialize<T>.")]
public static T? Deserialize<T>(this ITypeSerializer typeSerializer, byte[] buffer, int offset, int length)
Parameters
| Type | Name | Description |
|---|---|---|
| ITypeSerializer | typeSerializer | The ITypeSerializer. |
| byte[] | buffer | The buffer to deserialize from. |
| int | offset | The offset of the buffer to start reading from. |
| int | length | The length of the buffer to read from. |
Returns
| Type | Description |
|---|---|
| T | The Type instance representing the value of the key. |
Type Parameters
| Name | Description |
|---|---|
| T | The Type specified as the type of the value. |
Serialize(ITypeSerializer, object?)
Serializes the specified object onto a stream.
Declaration
public static byte[] Serialize(this ITypeSerializer typeSerializer, object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| ITypeSerializer | typeSerializer | The ITypeSerializer. |
| object | obj | The object to serialize. |
Returns
| Type | Description |
|---|---|
| byte[] | A byte array containing the serialized object. |