text: public byte[] ToArray(){if (arrays.Count==0){return null;}else if (arrays.Count > 1){int totalLength = 0;foreach (byte[] array in arrays){totalLength += array.Length;}byte[] concatenated = new byte[totalLength];int destPos = 0;foreach (byte[] array in arrays){Array.Copy(array, 0, concatenated, destPos, array.Length);destPos += array.Length;}arrays.Clear();arrays.Add(concatenated);}return arrays[(0)];}