//Add to the end of the buffer
//Copy N bytes in from source
pub fn add_slice(&mut self, source: &[u8]) {
    let remaining = self.capacity_remaining();
    let num_elements_to_add = source.len().min(remaining);
    if num_elements_to_add == 0 {
        return;
    }

    let (source_to_use, _discarded) = source.split_at(num_elements_to_add);

    //We will use exclusive ranges
    let begin_index = self.end;
    self.end += num_elements_to_add;
    self.length += num_elements_to_add;

    if let Some(ch) = self.data.get_mut(begin_index..self.end) {
        ch.copy_from_slice(source_to_use);
    } else {
        let seg_length1 = LEN - begin_index;
        let (a, b) = source_to_use.split_at(seg_length1);
        self.data[begin_index..=INDEX_MAX].copy_from_slice(a);
        self.data[..b.len()].copy_from_slice(b);
    }

    if self.end >= INDEX_MAX {
        self.end -= LEN;
    }
}