godzcheater

CombineByteArrays

Mar 4th, 2012
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 KB | None | 0 0
  1.         public static System.Byte[] CombineArrays(System.Byte[][] In)
  2.         {
  3.             System.Int32 Length = 0;
  4.             for (System.Int32 i = 0; i < In.Length; i++)
  5.             {
  6.                 Length += In[i].Length;
  7.             }
  8.  
  9.             System.Byte[] Out = new System.Byte[Length];
  10.             System.Int32 Offset = 0;
  11.             for (System.Int32 i = 0; i < In.Length; i++)
  12.             {
  13.                 In[i].CopyTo(Out, Offset);
  14.                 Offset += In[i].Length;
  15.             }
  16.  
  17.             return Out;
  18.         }
Advertisement
Add Comment
Please, Sign In to add comment