public static IEnumerable <T[]> Slices <T>(this T[] source, int count, bool padToLength = false) { for (var i = 0; i < source.Length; i += count) { yield return(source.CopySlice(i, count, padToLength)); } }