title: How to split a video into parts and then merge it with FileStream C#
body: <p>I have some problems with splitting the file and I don't know what to do now. I have to split the movie and then merge the splited elements into one. And i have to use FileStream. If you can help me, i will be really happy :)</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.IO;
  
  class Program
  {
      static void Main()
      {
          string source = "../../movie.avi";
          string destination;
          int n = int.Parse(Console.ReadLine());
          for (int i = 0; i &lt; n; i++)
          { 
              destination = "Part-" + i +".avi";
              Slice(source, destination, n);
          }
  
          List&lt;int&gt; files = new List&lt;int&gt;();
          //Assemble(, destination);
      }
  
      static void Slice(string sourceFile, string destinationDirectory, int parts)
      {
          using (var source = new FileStream(sourceFile, FileMode.Open))
          {
              for (int i = 0; i &lt; parts; i++)
              {
                  using (var destination = new FileStream(destinationDirectory, FileMode.CreateNew))
                  {
                      double fileLength = source.Length;
                      byte[] buffer = new byte[4096];
                      while (true)
                      {
                          int readBytes = source.Read(buffer, 0, buffer.Length);
                          if (readBytes == 0)
                          {
                              break;
                          }
                          destination.Write(buffer, 0, readBytes);
                      }
                  }
              }
          }
      }
      static void Assemble(List&lt;string&gt; files, string destinationDirectory)
      {
  
      }
  }
  </code></pre>