Are there any javascript libraries that can take a byte array and bz2 decompress it into another byte array? I know that many browsers have this capability for an entire stream, but this array is at an offset from the start of the stream.
Asked
Active
Viewed 6,333 times
0
-
Are you doing this in a browser? Or using node.js? – Kekoa Feb 24 '12 at 17:02
1 Answers
4
Yes. Here's ont for byte array: https://github.com/antimatter15/bzip2.js And for binary strings: https://github.com/kirilloid/bzip2-js

kirilloid
- 14,011
- 6
- 38
- 52
-
Great solution. I will just remark that while the input for the first js is a byte array, the output is a string, which threw me off at first (i'm not exactly a js guru) – graphicsMan Mar 22 '12 at 01:19
-
Here's also a Java applet http://kirilloid.ru/sc2replay/bzip2.jar with `BzipWrapper.class`, which have `decode` and `decodeBytes` methods with `(* data, int compressedLength, int length)` signature. `decode` accepts data as base64 encoded string, and `decodeBytes` accepts it as uint8array. – kirilloid Mar 22 '12 at 05:34