CSharp examples for System.Collections.Generic:List
Flatten List<byte[]>
using System.Linq; using System.Collections.Generic; using System;// w ww. j a v a 2s. c o m public class Main{ public static byte[] Flatten(this List<byte[]> arrays) { var size = arrays.Select(e => e.Length).Sum(); var result = new byte[size]; var offset = 0; foreach (var array in arrays) { array.CopyTo(result, offset); offset += array.Length; } return result; } }