如何转换' fflate的累积数据'拉链流到斑点供下载
该应用程序将在GB中创建大数据。存储到阵列并传递给Zip()的限制后,堆填充了。因此,我的计划是
- 使用zipdeflate .push()
- ondata商店
- 转换每行,以将数组转换为blob,可以将其保存为zip文件
findings
- 数据是一个uint8array
- new blob([MergedDatas])不是zip文件
const zippedData = []
const zip = new Zip();
zip.ondata = (err, data, final) => {
if (!err) {
zippedData.push(data)
if (final) {
// Here I want the zipped data to be downloaded
}
}
};
const frames = new ZipDeflate(exportName + '.lsf', {
level: 9,
});
zip.add(frames);
frames.push(header); // this is a uintd binary data
// there is lot of loops and things that will generate GBs of data eg. below two lines
frames.push(numberToBytes(branch.name));
frames.push(ColorByteArray);
// end of loop
frames.push(new Uint8Array(0), true);
zip.end();
The application will create a large data in GBs. After storing to an array and the passing to zip() worked to a limit , which the heap filled. So my plan is
- convert each line using ZipDeflate .push()
- ondata store to an array
- convert the array to blob that can be saved as a zip file
findings
- data is an Uint8Array
- new Blob([mergedDatas]) was not a zip file
const zippedData = []
const zip = new Zip();
zip.ondata = (err, data, final) => {
if (!err) {
zippedData.push(data)
if (final) {
// Here I want the zipped data to be downloaded
}
}
};
const frames = new ZipDeflate(exportName + '.lsf', {
level: 9,
});
zip.add(frames);
frames.push(header); // this is a uintd binary data
// there is lot of loops and things that will generate GBs of data eg. below two lines
frames.push(numberToBytes(branch.name));
frames.push(ColorByteArray);
// end of loop
frames.push(new Uint8Array(0), true);
zip.end();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
终于发现自己
处理的邮政流可以包装到斑点并下载
Finally found myself
processed ZipStreams can be packed to a blob and downloaded