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[].
Implements
Inherited Members
Namespace: Confluent.SchemaRegistry .Serdes
Assembly: Confluent.SchemaRegistry.Serdes.Avro.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)
Declaration
public AvroDeserializer(ISchemaRegistryClient schemaRegistryClient)
Parameters
Type | Name | Description |
---|---|---|
ISchema |
schemaRegistryClient |
AvroDeserializer(ISchemaRegistryClient, AvroDeserializerConfig, RuleRegistry)
Declaration
public AvroDeserializer(ISchemaRegistryClient schemaRegistryClient, AvroDeserializerConfig config = null, RuleRegistry ruleRegistry = null)
Parameters
Type | Name | Description |
---|---|---|
ISchema |
schemaRegistryClient | |
Avro |
config | |
Rule |
ruleRegistry |
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 |
---|---|---|
ISchema |
schemaRegistryClient | An implementation of ISchemaRegistryClient used for communication with Confluent Schema Registry. |
IEnumerable<Key |
config | Deserializer configuration properties (refer to
Avro |
Methods
DeserializeAsync(ReadOnlyMemory<byte>, bool, SerializationContext)
Deserialize an object of type T
from a byte array.
Declaration
public Task<T> DeserializeAsync(ReadOnlyMemory<byte> data, bool isNull, SerializationContext context)
Parameters
Type | Name | Description |
---|---|---|
Read |
data | The raw byte data to deserialize. |
bool | isNull | True if this is a null value. |
Serialization |
context | Context relevant to the deserialize operation. |