Encodes typed messages to bytes.
Separated from Decoder so that send-only streams can require only encoding capability. The type system prevents using an encoder where decoding is needed, and vice versa.
Encodes value to buffer at the current position.
Estimates the encoded size of value for buffer pre-allocation.