title: Why I need to read file piece by piece to buffer?
body: <p>I have seen following code for getting the file into array, which is in turn used as a parameter for SQL command inserting it into a blob column:</p>
  
  <pre><code>using (FileStream fs = new FileStream(soubor,FileMode.Open,FileAccess.Read))
  
  int length = (int)fs.Length;
  buffer = new byte[length];
  int count;
  int sum = 0;
  while ((count = fs.Read(buffer, sum, length - sum)) &gt; 0)
      sum += count;
  </code></pre>
  
  <p>Why I cannot simply do that:</p>
  
  <p>fs.Read(buffer, 0, length) in order to just copy content of file to the buffer?</p>
  
  <p>Thanks</p>