Why do i get out of bounds when using FileStream.Write?
<p>When I execute this code.</p>

<pre><code>Random R = new Random();
        byte[] BA = new byte[8192];
        R.NextBytes(BA);
        FileStream FS = new FileStream(@"D:\Test.txt", FileMode.Append);
        long end = FS.Seek(0, SeekOrigin.End);
        if (FS.CanWrite == true)
        {
            FS.Write(BA, (int)end, BA.Length);
            FS.Flush();
        }
        FS.Close();
</code></pre>

<p>It will work the first time I run it. If I try to run it a second time I get this error.</p>

<blockquote>
  <p>Offset and length were out of bounds for the array or count is greater
  than the number of elements from index to the end of the source
  collection.</p>
</blockquote>

<p>I do not undertand this error. Any help is appreciated.</p>
