title: How to write data to two java.io.OutputStream objects at once?
body: <p>I'm looking for magical Java class that will allow me to do something like this:</p>
  
  <pre><code>ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
  FileOutputStream fileStream = new FileOutputStream(new File("/tmp/somefile"));
  
  MultiOutputStream outStream = new MultiOutputStream(byteStream, fileStream);
  
  outStream.write("Hello world".getBytes());
  </code></pre>
  
  <p>Basically, I want <code>tee</code> for <code>OutputStream</code>s in Java. Any ideas?</p>
  
  <p>Thanks!</p>