title: Why does BinaryWriter prepend gibberish to the start of a stream?  How do you avoid it?
body: <p>I'm debugging some issues with writing pieces of an object to a file and I've gotten down to the base case of just opening the file and writing "TEST" in it.  I'm doing this by something like:</p>
  
  <pre><code>static FileStream fs;
  static BinaryWriter w;
  fs = new FileStream(filename, FileMode.Create);
  w = new BinaryWriter(fs);
  
  w.Write("test");
  
  w.Close();
  fs.Close();
  </code></pre>
  
  <p>Unfortunately, this ends up prepending a box to the front of the file and it looks like so:</p>
  
  <p>TEST, with a fun box on the front.  Why is this, and how can I avoid it?</p>
  
  <p>Edit: It does not seem to be displaying the box here, but it's the unicode character that looks like gibberish.</p>