KAA-280: Add routine to write an extension header to a buffer.