SizeEstimate

sealed interface SizeEstimate

Result of estimating the encoded size of a message.

Used for buffer pre-allocation. Exact enables precise allocation (no wasted bytes). UnableToPrecalculate falls back to a default buffer size.

Inheritors

Types

Link copied to clipboard
value class Exact(val bytes: Int) : SizeEstimate

Exact encoded size in bytes. Enables precise buffer allocation.

Link copied to clipboard

Cannot determine size without encoding. Use a default or growable buffer.