Decode the provided bytes into a string using the provided encoding.
(bytes: Uint8Array, encoding: string)
| 153 | } |
| 154 | /** Decode the provided bytes into a string using the provided encoding. */ |
| 155 | decode(bytes: Uint8Array, encoding: string): string { |
| 156 | // See https://www.w3.org/TR/encoding/#utf-16le |
| 157 | if (encoding === "utf-16") { |
| 158 | encoding = "utf16le"; |
| 159 | } |
| 160 | return Buffer.from(bytes).toString(encoding as BufferEncoding); |
| 161 | } |
| 162 | |
| 163 | now(): number { |
| 164 | //@ts-ignore |