title: How to fill a ByteArrayOutputStream with the content of a file?
body: <p>I have File and need to fill its content to a ByteArrayOutputStream, can someone help me with that? With Google Guava I am able to create an ByteArray but how do I get an ByteArrayOutputStream from this?</p>
  
  <pre><code>ByteArrayOutputStream baos = null;
  File img = new File("myTestfile.txt");
  byte[] filesBytes = Files.toByteArray(f);
  
  //does not work
  baos = new ByteArrayOutputStream(filesBytes);
  </code></pre>
  
  <p>Thanks</p>