std::string sPicName ="/share/alibowang/wb.jpg";
std::ifstream fs;
fs.open(sPicName.c_str(), std::ios::binary);
if(fs == NULL)
{
DEBUG_LOG("OPen failed");
}
//to test file buffer
int file_length = 0;
char * file_buffer;
// get length of file:
fs.seekg (0, std::ios::end);
file_length = fs.tellg();
fs.seekg (0, std::ios::beg);
// allocate memory:
file_buffer = new char [file_length];
// read data as a block:
DEBUG_LOG("file length is %d/n",file_length);
fs.read (file_buffer, file_length);
DEBUG_LOG("file length is %d/n",file_length);