(data)
| 31 | } |
| 32 | |
| 33 | encode(data) { |
| 34 | if (data.length > input.length) { |
| 35 | throw new Error(`Invalid sample count, expected: ${input.length}`); |
| 36 | } |
| 37 | |
| 38 | input.set(data); |
| 39 | const size = _wrapper_encode(this.#gf, data.length); |
| 40 | if (size < 0) { |
| 41 | throw new Error(`Failed to encode: ${size}`); |
| 42 | } |
| 43 | return output.subarray(0, size); |
| 44 | } |
| 45 | |
| 46 | flush() { |
| 47 | const size = _wrapper_flush(this.#gf); |
no test coverage detected