encodeSchema

open fun encodeSchema(buffer: ByteBuffer)

Encodes this schema's metadata into the provided buffer.

This method writes the complete schema definition to the buffer, starting with the tag and followed by any schema-specific metadata. The amount of data written must exactly match schemaSize.

Default Implementation: Writes the schema property directly to the buffer. This is suitable for most use cases but can be overridden for custom encoding logic.

Parameters

buffer

The buffer to write schema data to. Must have at least schemaSize bytes remaining.

Throws

if the buffer doesn't have enough space