title: create file and save to it using memorystream
body: <p>How can i create a file and write to it using the memory stream?
  I need to use the memorystream to prevent other threads from trying to access the file.</p>
  
  <p>The data i'm trying to save to a file is html.</p>
  
  <p>How can this be done?</p>