Api: zlib.unzipFile
版本适配:Api6
作用:解压文件,解压完成返回执行结果
示例代码:
import zlib from '@ohos.zlib'
var inFile = "/xx/xxx.zip";
var outFile = "/xxx";
let options = {
level: zlib.CompressLevel.COMPRESS_LEVEL_DEFAULT_COMPRESSION,
memLevel: zlib.MemLevel.MEM_LEVEL_DEFAULT,
strategy: zlib.CompressStrategy.COMPRESS_STRATEGY_DEFAULT_STRATEGY
};
zlib.unzipFile(inFile, outFile, options).then((data) => {
console.log("unzipFile result:" + data);
}).catch((err)=>{
console.log("catch((err)=>" + err);
})