(contents: string)
| 626 | } |
| 627 | |
| 628 | function encodeFileContents(contents: string): ArrayBuffer { |
| 629 | const bytes = new TextEncoder().encode(contents); |
| 630 | const buffer = new ArrayBuffer(bytes.length); |
| 631 | new Uint8Array(buffer).set(bytes); |
| 632 | return buffer; |
| 633 | } |
| 634 | |
| 635 | function copyBytes(bytes: Uint8Array): ArrayBuffer { |
| 636 | const buffer = new ArrayBuffer(bytes.byteLength); |