Method ToArray
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
valueTThe object.
schemaAvroSchemaThe schema the object is written with; its fingerprint goes into the header.
writeAvroWriteAction<T>Writes the object in
schema's encoding; for a generated type, its staticWritemethod.
Returns
- byte[]
Type Parameters
TThe 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
valueAvroValueThe value.
writerGenericDatumWriterThe 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
valueTThe value.
Returns
- byte[]
Type Parameters
TA generated type.