encode

Encodes one complete value, rejecting oversized output before growing its buffer.