title: stream to byte array
body: <p>I'm creating a program in native C++ (no clr). I'm using a toolkit which converts data and normally writes it to a file or stdout.
  The issue is that I want to write it to an array and I don't know the size which will be sent.
  The toolkit requires a paramter "FILE *" and cannot be modified.</p>
  
  <p>Basically working code:</p>
  
  <pre><code>FILE * ofile = fopen("yourfile.dat", "wb");
  toolkit::function(ofile);
  fclose(ofile);
  </code></pre>
  
  <p>to std out the first line would be</p>
  
  <pre><code>FILE * ofile = stdout;
  </code></pre>
  
  <p>What I want now, is that I have can perform the function end in the end have a pointer to an array op byte (e.g. char *) and the size of it.
  I've been looking around an can find the sollution.
  First writing to a file is not an option.</p>