title: Conveniently copy std::vector<unsigned char> to input stream (std::istream) object
body: <p>I'm trying to make use of a function which comes in a 3rd party lib and expects an input stream object in which binary file data is transported.</p>
  
  <p>Signature looks like that:</p>
  
  <pre><code>doSomething(const std::string&amp; ...,
            const std::string&amp; ...,
            std::istream&amp; aData,
            const std::string&amp; ...,
            const std::map&lt;std::string, std::string&gt;* ...,
            long ...,
            bool ...);
  </code></pre>
  
  <p>Since I can't alter/change this 3rd party lib/function, I have to adapt in "my" code. In the calling place, I have a std::vector which contains the data which is expected to be passed in an istream object. Currently I copy the vector to the stream, by iterating over it and using the &lt;&lt; operator to copy byte by byte.</p>
  
  <p>I strongly suspect that there might be a more effective/convenient way but couldn't find anything useful up to now. Any help/your thoughts are greatly appreciated.</p>
  
  <p>Best,
  JR</p>