1
0
Fork 0
mirror of https://github.com/codedread/bitjs synced 2025-10-03 17:49:16 +02:00

Make buffers transferable out of the Worker for unrar/untar too

This commit is contained in:
Jeff Schiller 2021-12-12 12:58:34 -08:00
parent 85dcee80ec
commit 755aba54bd
2 changed files with 4 additions and 2 deletions

View file

@ -100,6 +100,7 @@ class TarLocalFile {
// Done header, now rest of blocks are the file contents.
this.filename = this.name;
/** @type {Uint8Array} */
this.fileData = null;
info("Untarring file '" + this.filename + "'");
@ -146,7 +147,7 @@ const untar = function () {
currentFileNumber = totalFilesInArchive++;
currentBytesUnarchivedInFile = oneLocalFile.size;
currentBytesUnarchived += oneLocalFile.size;
postMessage({ type: 'extract', unarchivedFile: oneLocalFile });
postMessage({ type: 'extract', unarchivedFile: oneLocalFile }, [oneLocalFile.fileData.buffer]);
postProgress();
}
}