Table of Contents

Method ToArray

Namespace
AvroSharp.Messages
Assembly
AvroSharp.dll

ToArray<T>(AvroRegistryFraming, AvroSchemaId, T, AvroWriteAction<T>)

Writes one object as a framed message to a new array.

public static byte[] ToArray<T>(AvroRegistryFraming framing, AvroSchemaId id, T value, AvroWriteAction<T> write)

Parameters

framing AvroRegistryFraming

The registry's framing.

id AvroSchemaId

The schema ID the registry assigned to the writer schema.

value T

The object.

write AvroWriteAction<T>

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

Returns

byte[]

Type Parameters

T

The type of the object.

ToArray(AvroRegistryFraming, AvroSchemaId, in AvroValue, GenericDatumWriter)

Writes a generic value as a framed message to a new array.

public static byte[] ToArray(AvroRegistryFraming framing, AvroSchemaId id, in AvroValue value, GenericDatumWriter writer)

Parameters

framing AvroRegistryFraming

The registry's framing.

id AvroSchemaId

The schema ID the registry assigned to the writer's schema.

value AvroValue

The value.

writer GenericDatumWriter

The generic writer for the schema.

Returns

byte[]

ToArray<T>(AvroRegistryFraming, AvroSchemaId, T)

Writes a schema-registry message of a generated type to a new array.

public static byte[] ToArray<T>(AvroRegistryFraming framing, AvroSchemaId id, T value) where T : IAvroSerializable<T>

Parameters

framing AvroRegistryFraming

The message framing.

id AvroSchemaId

The schema's ID in the registry.

value T

The value.

Returns

byte[]

Type Parameters

T

A generated type.