title: Some bytes are missing after reading an std::ifstream to a vector of lines
body: <p>For copying what I read from input file to vector, I used <code>std::copy()</code> as recommended in <a href="https://stackoverflow.com/questions/1675508/reading-an-stdifstream-to-a-vector-of-lines">Reading an std::ifstream to a vector of lines</a>.</p>
  
  <p>The problem occurs if I use: </p>
  
  <pre><code>std::copy(std::istream_iterator&lt;unsigned char&gt;(inputfile),
            std::istream_iterator&lt;unsigned char&gt;(),
            std::back_inserter(myVector));
  </code></pre>
  
  <p>The 16th byte of my file is missing in the <code>myVector</code> variable.</p>
  
  <p>But if I use the following code:</p>
  
  <pre><code>inputfile.read((char*)&amp;myVector[0], sizeof(int)*getfilesize(nameOfFile));
  </code></pre>
  
  <p>Then the byte is not missing anymore. </p>
  
  <p>I am trying to parse WAV files and I lost too much time on this, I hope I will learn something new out of this. Can you please tell me what is wrong with the first version of the code above? </p>