(byteLength: number)
| 17 | export class VSBuffer { |
| 18 | |
| 19 | static alloc(byteLength: number): VSBuffer { |
| 20 | if (hasBuffer) { |
| 21 | return new VSBuffer(Buffer.allocUnsafe(byteLength)); |
| 22 | } else { |
| 23 | return new VSBuffer(new Uint8Array(byteLength)); |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | static wrap(actual: Uint8Array): VSBuffer { |
| 28 | if (hasBuffer && !(Buffer.isBuffer(actual))) { |