(source: string)
| 34 | } |
| 35 | |
| 36 | static fromString(source: string): VSBuffer { |
| 37 | if (hasBuffer) { |
| 38 | return new VSBuffer(Buffer.from(source)); |
| 39 | } else if (hasTextEncoder) { |
| 40 | if (!textEncoder) { |
| 41 | textEncoder = new TextEncoder(); |
| 42 | } |
| 43 | return new VSBuffer(textEncoder.encode(source)); |
| 44 | } else { |
| 45 | return new VSBuffer(strings.encodeUTF8(source)); |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | static concat(buffers: VSBuffer[], totalLength?: number): VSBuffer { |
| 50 | if (typeof totalLength === 'undefined') { |