title: Better way to determine length of a std::istream?
body: <p>Is there a better way to determine the length of an std::istream than the following:</p>
  
  <pre><code>std::istream* pcStream = GetSomeStream();
  pcStream-&gt;seekg(0, ios::end);
  unsigned int uiLength = pcStream-&gt;tellg();
  </code></pre>
  
  <p>It just seems really wasteful to have to seek to the end of the stream and then seek back to the original position, especially if the stream might be to a file on some slow media like a CD or DVD.</p>