Class AvroDeserializer<T>
(async) Avro deserializer. Use this deserializer with GenericRecord, types generated using the avrogen.exe tool or one of the following primitive types: int, long, float, double, boolean, string, byte[].
Inheritance
Namespace: Confluent.SchemaRegistry.Serdes
Assembly: cs.temp.dll.dll
Syntax
public class AvroDeserializer<T> : IAsyncDeserializer<T>
Type Parameters
Name | Description |
---|---|
T |
Remarks
Serialization format: byte 0: Magic byte use to identify the protocol format. bytes 1-4: Unique global id of the Avro schema that was used for encoding (as registered in Confluent Schema Registry), big endian. following bytes: The serialized data.
Constructors
AvroDeserializer(ISchemaRegistryClient, IEnumerable<KeyValuePair<String, String>>)
Initialize a new AvroDeserializer instance.
Declaration
public AvroDeserializer(ISchemaRegistryClient schemaRegistryClient, IEnumerable<KeyValuePair<string, string>> config = null)
Parameters
Type | Name | Description |
---|---|---|
ISchemaRegistryClient | schemaRegistryClient | An implementation of ISchemaRegistryClient used for communication with Confluent Schema Registry. |
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.String>> | config | Deserializer configuration properties (refer to AvroDeserializerConfig). |
Methods
DeserializeAsync(ReadOnlyMemory<Byte>, Boolean, SerializationContext)
Deserialize an object of type T
from a byte array.
Declaration
public async Task<T> DeserializeAsync(ReadOnlyMemory<byte> data, bool isNull, SerializationContext context)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlyMemory<System.Byte> | data | The raw byte data to deserialize. |
System.Boolean | isNull | True if this is a null value. |
SerializationContext | context | Context relevant to the deserialize operation. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<T> | A System.Threading.Tasks.Task that completes with the deserialized value. |