| 313 | } |
| 314 | |
| 315 | bool ZipUtils::isGZipFile(const char *path) { |
| 316 | // load file into memory |
| 317 | Data compressedData = FileUtils::getInstance()->getDataFromFile(path); |
| 318 | |
| 319 | if (compressedData.isNull()) { |
| 320 | CC_LOG_DEBUG("ZipUtils: loading file failed"); |
| 321 | return false; |
| 322 | } |
| 323 | |
| 324 | return isGZipBuffer(compressedData.getBytes(), compressedData.getSize()); |
| 325 | } |
| 326 | |
| 327 | bool ZipUtils::isGZipBuffer(const unsigned char *buffer, uint32_t len) { |
| 328 | if (len < 2) { |
nothing calls this directly
no test coverage detected