title: convert binary file to text
body: <p>I have a  program that gets a response from a url in binary format and I do not know how to convert this to a text file.</p>
  
  <pre><code>byte[] postBytes = System.Text.Encoding.UTF8.GetBytes(postString);
  request.ContentLength = postBytes.Length;
  Stream stream = request.GetRequestStream();
  stream.Write(postBytes, 0, postBytes.Length);
  stream.Close();
  
  response = (HttpWebResponse)request.GetResponse();
  Stream ReceiveStream = response.GetResponseStream();
  string filename = "C:\\responseGot.txt";
  
  byte[] buffer = new byte[1024];
  FileStream outFile = new FileStream(filename, FileMode.Create);
  int bytesRead;
  while ((bytesRead = ReceiveStream.Read(buffer, 0, buffer.Length)) != 0) 
      outFile.Write(buffer, 0, bytesRead);
  </code></pre>
  
  <p>When I open responseGot.txt it is a binary file how do I get text file. </p>