I try to use an example shown here: zlib-decompression-client-side
but I am unable to use the sample shown on JSfidle: decompress byteArray
I downloaded pako.js but no success. I even tried to copy the code given about the sample: pako.js
but I keep getting an error.
var charData = [31, 139, 8, 0, 0, 0, 0, 0, 0, 3, 5, 193, 219, 13, 0, 16, 16, 4, 192, 86, 214, 151, 102, 52, 33, 110, 35, 66, 108, 226, 60, 218, 55, 147, 164, 238, 24, 173, 19, 143, 241, 18, 85, 27, 58, 203, 57, 46, 29, 25, 198, 34, 163, 193, 247, 106, 179, 134, 15, 50, 167, 173, 148, 48, 0, 0, 0];
var binData = new Uint8Array(charData);
** here I get error: Typed array constructor argument is invalid **
// Pako magic
var data = pako.inflate(binData);
// Convert gunzipped byteArray back to ascii string:
var strData = String.fromCharCode.apply(null, new Uint16Array(data));
// Output to console
alert(strData);
any help will be appreciated.