title: Convert float to its binary representation (using MemoryStream?)
body: <p>I'd like to convert a given <code>float</code> into its binary representation. I tried to write the float value into a <code>MemoryStream</code>, read this <code>MemoryStream</code> byte by byte and convert the bytes into their binary representation. But every attempt failed.</p>
  
  <ul>
  <li>"Can't read closed stream" (but I only closed the writer)</li>
  <li>For test purposes I simply wrote an integer (I think four bytes in size) and the length of the <code>MemoryStream</code> was 0, when I didn't flush the <code>StreamWriter</code>, and 1, when I did.</li>
  </ul>
  
  <p>I'm sure there is a better way to convert <code>float</code>s to binary, but I also wanted to learn a little bit about the <code>MemoryStream</code> class.</p>