pub fn slice_to_buf<B: Default + BufMut>(s: &[u8]) -> B
Converts a byte slice to a buffer by copying.