/** * 将unsigned char数组转换成long long数值 * {0x00 0x00 0x20 0x00}转换之后得到8192 * * @param str 数组 * @param len str数组长度 * @returns 0 on error */ LONGLONG PNGProcesser::readCharToLL(unsigned char* str, int len) { if (len <= 0) { return 0; } int i = 0; int value = 0; for (i=0;i<len;i++) { value = value*16*16 + (str[i]/16)*16 + str[i]%16; } return value; }