我正在使用 ZLibDeflater 来压缩文件,方法是将其作为流读取并进行转换:
new File(filePath)
.openRead()
.transform(new ZLibDeflater())
.pipe(new File(gzipPath).openWrite())
.then(...);
作为 ZLibDeflater is now deprecated ,如何转换代码以使用新的 GZipCodec类?
最佳答案
您还可以使用ZLIB :
new File(filePath)
.openRead()
.transform(ZLIB.decoder)
.pipe(new File(zlibPath).openWrite())
.then(...);
关于dart - 如何用 ZLibEncoder 替换 ZLibDeflater,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18534876/