Table of Contents

Method TrySerialize

Namespace
AvroSharp.Serialization
Assembly
AvroSharp.dll

TrySerialize<T>(Span<byte>, T, out int)

Writes a value into destination, allocating nothing.

public static bool TrySerialize<T>(Span<byte> destination, T value, out int bytesWritten) where T : IAvroSerializable<T>

Parameters

destination Span<byte>

The caller's memory.

value T

The value.

bytesWritten int

The bytes written, or 0 when the value does not fit.

Returns

bool

true when the value fit.

Type Parameters

T

A generated type.