pub fn write_array_to_buffer<T: Copy>(
    buffer: *mut u8,
    count: u32,
    array: &ArrayVec<[T; 8]>
) -> *mut u8