title: How to Use AWS S3 C++ SDK TransferManager DownloadFile Callback
body: <p>I'm trying to use the AWS C++ SDK and Aws::Transfer::TransferManager to download a file from S3 into memory.</p>
  
  <p>The function I want to use is:</p>
  
  <pre><code>std::shared_ptr&lt; TransferHandle &gt; DownloadFile (const Aws::String &amp;bucketName, const Aws::String &amp;keyName, CreateDownloadStreamCallback writeToStreamfn)
  </code></pre>
  
  <p>However I'm not sure how the CreateDownloadStreamCallback argument is supposed to work.</p>
  
  <p>CreateDownloadStreamCallback is a typedef of</p>
  
  <pre><code>std::function&lt;Aws::IOStream*(void)&gt; 
  </code></pre>
  
  <p>I'm not sure what should go into this callback function to create and return an Aws::IOStream.</p>
  
  <p>How is this callback function supposed to work?</p>