code: function decode(num, table, lengths) {
      /** @type {number} */
      var code;
      /** @type {number} */
      var prev;
      /** @type {number} */
      var repeat;
      /** @type {number} */
      var i;
  
      for (i = 0; i < num;) {
        code = this.readCodeByTable(table);
        switch (code) {
          case 16:
            repeat = 3 + this.readBits(2);
            while (repeat--) { lengths[i++] = prev; }
            break;
          case 17:
            repeat = 3 + this.readBits(3);
            while (repeat--) { lengths[i++] = 0; }
            prev = 0;
            break;
          case 18:
            repeat = 11 + this.readBits(7);
            while (repeat--) { lengths[i++] = 0; }
            prev = 0;
            break;
          default:
            lengths[i++] = code;
            prev = code;
            break;
        }
      }
  
      return lengths;
    }
docs: decode function
  @param {number} num number of lengths.
  @param {!Array} table code lengths table.
  @param {!(Uint8Array|Array.<number>)} lengths code lengths buffer.
  @return {!(Uint8Array|Array.<number>)} code lengths buffer.