Couchbase .NET SDK __CB_SDK_VERSION__

Show / Hide Table of Contents

Interface ITypeSerializer

Provides an interface for serialization and deserialization of K/V pairs.

Namespace: Couchbase.Core.IO.Serializers
Assembly: Couchbase.NetClient.dll
Syntax
public interface ITypeSerializer

Methods

View Source

DeserializeAsync<T>(Stream, CancellationToken)

Deserializes the specified stream into the Type T specified as a generic parameter.

Declaration
ValueTask<T?> DeserializeAsync<T>(Stream stream, CancellationToken cancellationToken = default)
Parameters
Type Name Description
Stream stream

The stream.

CancellationToken cancellationToken

Cancellation token.

Returns
Type Description
ValueTask<T>

The Type instance representing the value of the key.

Type Parameters
Name Description
T

The Type specified as the type of the value.

View Source

Deserialize<T>(Stream)

Deserializes the specified stream into the Type T specified as a generic parameter.

Declaration
T? Deserialize<T>(Stream stream)
Parameters
Type Name Description
Stream stream

The stream.

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.

View Source

Deserialize<T>(ReadOnlyMemory<byte>)

Deserializes the specified buffer into the Type T specified as a generic parameter.

Declaration
T? Deserialize<T>(ReadOnlyMemory<byte> buffer)
Parameters
Type Name Description
ReadOnlyMemory<byte> buffer

The buffer to deserialize 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.

View Source

Serialize(Stream, object?)

Serializes the specified object onto a stream.

Declaration
void Serialize(Stream stream, object? obj)
Parameters
Type Name Description
Stream stream

The stream to receive the serialized object.

object obj

The object to serialize.

View Source

SerializeAsync(Stream, object?, CancellationToken)

Serializes the specified object onto a stream.

Declaration
ValueTask SerializeAsync(Stream stream, object? obj, CancellationToken cancellationToken = default)
Parameters
Type Name Description
Stream stream

The stream to receive the serialized object.

object obj

The object to serialize.

CancellationToken cancellationToken

Cancellation token.

Returns
Type Description
ValueTask
View Source

SerializeAsync<T>(Stream, T, CancellationToken)

Serializes the specified object onto a stream.

Declaration
ValueTask SerializeAsync<T>(Stream stream, T obj, CancellationToken cancellationToken = default)
Parameters
Type Name Description
Stream stream

The stream to receive the serialized object.

T obj

The object to serialize.

CancellationToken cancellationToken

Cancellation token.

Returns
Type Description
ValueTask
Type Parameters
Name Description
T

Type of object to serialize.

View Source

Serialize<T>(Stream, T)

Serializes the specified object onto a stream.

Declaration
void Serialize<T>(Stream stream, T obj)
Parameters
Type Name Description
Stream stream

The stream to receive the serialized object.

T obj

The object to serialize.

Type Parameters
Name Description
T

Type of object to serialize.

Extension Methods

TypeSerializerExtensions.Deserialize<T>(ITypeSerializer, byte[], int, int)
TypeSerializerExtensions.Serialize(ITypeSerializer, object?)
  • View Source
In this article
Back to top Copyright © 2020 Couchbase, Inc. All rights reserved.