std::fstream fin("fine.name",std::fstream::in|std::fstream::ate);
if(fin.good()) {
size_t file_size=fin.tellg();
fin.seekg(0,std::fstream::beg);
size_t read_per=100;
size_t read_sum=0;
std::vector<char> file_data_vec(read_per,0);
while(read_sum<file_size) {
size_t read_can=std::min(read_per,file_size-read_sum);
fin.read(file_data_vec.data(),read_can);
read_sum+=read_can;
//operation
}
fin.close();
}