rtoro / lzma-js

Other
4 stars 3 forks source link

Error in lzma data stream ? #1

Open Murilo-Perrone opened 5 years ago

Murilo-Perrone commented 5 years ago

I have created the lzma archive with many different tools but I always fall into the same error:

Error in lzma data stream

Here is the file reading code (using angular/http):

const response = await this.http.get('assets/data/testfile.lzma').toPromise();
const arrayBuffer = await response.arrayBuffer();

Here is the decompression code:

      var inStream = new LZMA.iStream(arrayBuffer);
      var outStream = LZMA.decompressFile(inStream);
      var bytes = outStream.toUint8Array();
      var stringData = outStream.toString();

I'm using lzma.js and lzma.shim.js.

mirosurabu commented 3 months ago

I am able to get it to work with a file generated by XZ Utils. 7zip and Peazip are producing the same error as you mention.