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
Type | Name | Description |
---|---|---|
SchemaId | schemaId |
Returns
Type | Description |
---|---|
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
Type | Name | Description |
---|---|---|
Span<byte> | buffer | |
SerializationContext | context | |
SchemaId | schemaId |