fn read_byte_array<const N: usize>(data: &[u8], offset: &mut usize) -> [u8; N]