Couchbase .NET SDK __CB_SDK_VERSION__

Show / Hide Table of Contents

Interface IBufferedTypeSerializer

Extension of ITypeSerializer which can read from ReadOnlySequence<T> and write to IBufferWriter<T>.

Inherited Members
ITypeSerializer.Deserialize<T>(ReadOnlyMemory<byte>)
ITypeSerializer.Deserialize<T>(Stream)
ITypeSerializer.DeserializeAsync<T>(Stream, CancellationToken)
ITypeSerializer.Serialize(Stream, object)
ITypeSerializer.SerializeAsync(Stream, object, CancellationToken)
ITypeSerializer.Serialize<T>(Stream, T)
ITypeSerializer.SerializeAsync<T>(Stream, T, CancellationToken)
Namespace: Couchbase.Core.IO.Serializers
Assembly: Couchbase.NetClient.dll
Syntax
public interface IBufferedTypeSerializer : ITypeSerializer

Methods

View Source

CanSerialize(Type)

Determines if the serializer can serialize and deserialize the specified type.

Declaration
bool CanSerialize(Type type)
Parameters
Type Name Description
Type type

Type of object to serialize or deserialize.

Returns
Type Description
bool

true if the type can be serialized and deserialized.

View Source

Deserialize<T>(ReadOnlySequence<byte>)

Deserializes the specified buffer into the type specified by T.

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

The buffer to deserialize from.

Returns
Type Description
T

The deserialized value.

Type Parameters
Name Description
T

The type of the value.

View Source

Serialize<T>(IBufferWriter<byte>, T)

Serializes the specified object onto an IBufferWriter<T>.

Declaration
void Serialize<T>(IBufferWriter<byte> writer, T obj)
Parameters
Type Name Description
IBufferWriter<byte> writer

The writer 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.