codedread / bitjs

Binary Tools for JavaScript
MIT License
84 stars 7 forks source link

Unarchive from a stream of bytes #7

Closed codedread closed 6 years ago

codedread commented 6 years ago

Today, the unarchivers require the entire ArrayBuffer to be available before it can start unarchiving. This works fine for local files, but for anything else (network fetches) it requires the entire file to be downloaded before unarchiving can begin.

Should investigate reworking the code and API to deal with a stream of bytes.

codedread commented 6 years ago

Commit ec27877ffa070fa7d8343ab4496bd7b053f6e826 made the BitStream and ByteStreams throw errors if trying to seek past the end. Commit 26d06e8d3bce6ce817b8caa101c6c474ed81c82f made ByteStreams pushable. Commit 5b10c1a986295352f64cab693aaba8c01958cfb9 made BitStreams pushable. Commit 5aa0110faf792080ad13cef34617c2982e5cf115 gave the ability for the streams to be teed.

codedread commented 6 years ago

Commit 3c5c9cbd4c5a7896a871e444adf4c0581bdb27c1 Fixed the tee() method and exposed a method to get the amount of data currently in stream. Commit 9d08824bfd1c722b43acc5634d6a81ac9e29316e Allowed Unarchiver objects to have data pushed to them and updated unzip to support streaming bytes.

codedread commented 6 years ago

Commit 9f9cd945474e300c9a870c83a3668c335d64ed49 updated unrar for streaming Commit 3268d3d10a078649ad3cfba556250132babf61e8 updated unzip for streaming