png-compressor
    Preparing search index...

    Function Inflate

    • new Inflate(options)

      • options (Object): zlib inflate options.

      Creates new inflator instance with specified params. Throws exception on bad params. Supported options:

      • windowBits
      • dictionary

      http://zlib.net/manual.html#Advanced for more information on these.

      Additional options, for internal needs:

      • chunkSize - size of generated data chunks (16K by default)
      • raw (Boolean) - do raw inflate
      • to (String) - if equal to 'string', then result will be converted from utf8 to utf16 (javascript) string. When string output requested, chunk length can differ from chunkSize, depending on content.

      By default, when no options set, autodetect deflate/gzip data format via wrapper header.

      const pako = require('pako')
      const chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])
      const chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);

      const inflate = new pako.Inflate({ level: 3});

      inflate.push(chunk1, false);
      inflate.push(chunk2, true); // true -> last chunk

      if (inflate.err) { throw new Error(inflate.err); }

      console.log(inflate.result);

      Parameters

      • options: { windowBits?: number } = {}

      Returns void