title: Convert fileoutputstream to a string
body: <p>I have a java program where I am writing to a file using <code>OutputStream</code>. Everything is working fine. Upon completion of the program, I see data in my file. However, I would like to see this data on the <code>System.out</code> as well. </p>
  
  <p>How can I convert <code>OutputStream</code> to a <code>String</code> so that I can simply <code>System.out.println();</code> it? I tried <code>fos.toString()</code> but that prints <code>java.io.FileOutputStream@1ed2e55e</code></p>