title: Do I need to do StreamWriter.flush()?
body: <p>Suppose this C# code:</p>
  
  <pre><code>using (MemoryStream stream = new MemoryStream())
  {
      StreamWriter normalWriter = new StreamWriter(stream);
      BinaryWriter binaryWriter = new BinaryWriter(stream);
  
      foreach(...)
      {
          binaryWriter.Write(number);
          normalWriter.WriteLine(name); //&lt;~~ easier to reader afterward.
      }
  
      return MemoryStream.ToArray();
  }
  </code></pre>
  
  <p>My questions are:</p>
  
  <ol>
  <li>Do I need to use flush inside the
  loop to preserve order?</li>
  <li>Is returning <code>MemoryStream.ToArray()</code> legal? I using the <code>using</code>-block as a convention, I'm afraid it will mess things up.</li>
  </ol>