title: how to combine multiples bytes arrays into one to create a the file
body: <p>The help I need is to know how can I combine multiples byte array of 1024 bytes length each, into one byte array to create the file. </p>
  
  <p>I need to do this because I have to send multiples files to SAP, but the files must be split in byte arrays of 1024 (byte[1024]) and after I split the files I'm saving this ones into a collection, and the problem I having is when the file is created in SAP this one is corrupt. And I want to discard any problem when I split the files</p>
  
  <p>this ones are the methods I'm using to split the files</p>
  
  <pre><code>for (int i = 0; i &lt; attachRaw.Count(); i++)
          {
              countLine = attachRaw[i].content.Length / 1024;
              if (attachRaw[i].content.Length % 1024 != 0)
                  countLine++;
              ZFXX_ATTATTACHMENT_VBA[] attachArray = new ZFXX_ATTATTACHMENT_VBA[countLine];               
              for (int y = 0; y &lt; countLine; y++)
              {
                  ZFXX_ATTATTACHMENT_VBA attach = new ZFXX_ATTATTACHMENT_VBA();
                  attach.CONTENT = new byte[i == (countLine - 1) ? (attachRaw[i].content.Length - i * 1024) : 1024];
                  if (i == (countLine - 1))
                  {
                      countLine++;
                      countLine--;
                  }
                  if (attachRaw[i].content.Length &lt; 1024)
                  {
                      attach.CONTENT = attachRaw[i].content;
                  }
                  else
                  {
                      attach.CONTENT = FractionByteArray(i * 1024, (i == (countLine - 1) ? attachRaw[i].content.Length : (i * 1024 + 1024)), attachRaw[i].content);
                  }
                  attach.FILE_LINK = attachRaw[i].fileLink;
                  attachmentRaw.Add(attach);
  
              }
  
          }
  
  
  private static byte[] FractionByteArray(int start, int finish, byte[] array)
      {
          byte[] returnArray = new byte[finish - start];
  
          for (int i = 0; i &lt; finish - start; i++)
          {
              returnArray[i] = array[start + i];
          }
          return returnArray;
      }
  </code></pre>