confluent-kafka-dotnet
Show / Hide Table of Contents

Interface ISchemaIdEncoder

Interface for encoding schema IDs or GUIDs.

Namespace: Confluent.SchemaRegistry
Assembly: Confluent.SchemaRegistry.dll
Syntax
public interface ISchemaIdEncoder

Methods

CalculateSize(ref SchemaId)

Calculates the number of bytes required to encode the schema ID or GUID. Returns 0 if the schema is encoded in headers instead of the buffer.

Declaration
int CalculateSize(ref SchemaId schemaId)
Parameters
TypeNameDescription
SchemaIdschemaId
Returns
TypeDescription
int

Encode(Span<byte>, ref SerializationContext, ref SchemaId)

Encodes the schema ID or GUID into the provided buffer. The buffer is expected to be large enough to hold the data. Use CalculateSize(ref SchemaId) to determine the required size.

Declaration
void Encode(Span<byte> buffer, ref SerializationContext context, ref SchemaId schemaId)
Parameters
TypeNameDescription
Span<byte>buffer
SerializationContextcontext
SchemaIdschemaId
In this article