fn encode_extensions(extensions: &[u8], buf: &mut impl BufMut)
Encode extension bytes back to the buffer.