Allow buffers of size 0 when serializing envelopes in EnvelopeWriter