* Get encoded length * @returns Encoded length, the sum of frequencies * lengths
()
| 296 | * @returns Encoded length, the sum of frequencies * lengths |
| 297 | */ |
| 298 | public getEncodedLength(): number { |
| 299 | let len = 0; |
| 300 | for (let i = 0; i < this.freqs.length; i++) { |
| 301 | len += this.freqs[i] * this.length![i]; |
| 302 | } |
| 303 | return len; |
| 304 | } |
| 305 | |
| 306 | /** |
| 307 | * Scan a literal or distance tree to determine the frequencies of the codes |