title: Returning big size byte array or using ByteArrayOutputStream
body: <p>My question is with big size byte array (from 10k bytes), should I return direct the byte array value like this:</p>
  
  <pre><code>byte[] my_function() {
  ...
  return value;
  }
  </code></pre>
  
  <p>or use ByteArrayOutputStream/OutputStream as an param?</p>
  
  <pre><code>void my_function(ByteArrayOutputStream os) {
  ...
  os.write(value);
  }
  </code></pre>
  
  <p>Could you show me the advantage of using ByteArrayOutputStream/OutputStream against returning the result direct?</p>