ArrayUtil.cs 714 B

12345678910111213141516171819202122232425
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace Aitex.Core.Util
  6. {
  7. public static class ArrayUtil
  8. {
  9. public static byte[] CombomBinaryArray(byte[] srcArray1, byte[] srcArray2)
  10. {
  11. //根据要合并的两个数组元素总数新建一个数组
  12. byte[] newArray = new byte[srcArray1.Length + srcArray2.Length];
  13. //把第一个数组复制到新建数组
  14. Array.Copy(srcArray1, 0, newArray, 0, srcArray1.Length);
  15. //把第二个数组复制到新建数组
  16. Array.Copy(srcArray2, 0, newArray, srcArray1.Length, srcArray2.Length);
  17. return newArray;
  18. }
  19. }
  20. }