I have the following code that I used in an 188 byte file:
std::ifstream is("filename", std::ios::binary); std::vector<uint8_t> buffer; std::istream_iterator<uint8_t> i_input(is); std::copy(i_input, std::istream_iterator<uint8_t>(), std::back_inserter(buffer)); std::cout << buffer.size();
However, it reads only 186 bytes from 188 bytes.
I confirmed the file size in hexeditor as well as ls -al .
source share