fn reserve_and_pad<A: Allocator>( pos_mut: &mut u64, vec: &mut Vec<u8, A>, buf_len: usize, ) -> Result<usize>
Reserves the required space, and pads the vec with 0s if necessary.