std::ifstream is;
is.open(file2.c_str(), std::ofstream::in);
is.seekg(0, ios::end);
int len = is.tellg();
char * df = (char*)malloc(len + sizeof(char));df[0] = '\0';
is.seekg(0, ios::beg);
is.read(df, len);
len = is.tellg();
is.close();
读取一aac文件,不加ios::binary, read后tellg,值为-1,加了ios::binary后值为文件的长度。