title: Using Java OutputStream
body: <p>I need to print a representation of an ArrayList of strings to the given output stream (out):</p>
  
  <pre><code>public void outputBag(OutputStream out)
          throws IOException
  {
  
  
  }
  </code></pre>
  
  <p>I'd usually do this in the main function by using writer and be done with it. But I have to use the above method this time. Thing is, I have no idea how OutputStream is supposed to work, I spent a couple of hours reading javadocs and watching videos but to no avail.</p>
  
  <p>Can you guys show me an example of how I'd do this?</p>