Table of Contents

Method ToArray

Namespace
AvroSharp.Messages
Assembly
AvroSharp.dll

ToArray<T>(T, AvroSchema, AvroWriteAction<T>)

Writes one object as a single-object encoded message to a new array.

public static byte[] ToArray<T>(T value, AvroSchema schema, AvroWriteAction<T> write)

Parameters

value T

The object.

schema AvroSchema

The schema the object is written with; its fingerprint goes into the header.

write AvroWriteAction<T>

Writes the object in schema's encoding; for a generated type, its static Write method.

Returns

byte[]

Type Parameters

T

The type of the object.

ToArray(in AvroValue, GenericDatumWriter)

Writes a generic value as a single-object encoded message to a new array.

public static byte[] ToArray(in AvroValue value, GenericDatumWriter writer)

Parameters

value AvroValue

The value.

writer GenericDatumWriter

The generic writer; its schema's fingerprint goes into the header.

Returns

byte[]

ToArray<T>(T)

Writes a single-object message of a generated type to a new array.

public static byte[] ToArray<T>(T value) where T : IAvroSerializable<T>

Parameters

value T

The value.

Returns

byte[]

Type Parameters

T

A generated type.