* Writes the given data to the buffer. Resolves to the number of bytes * written. * * > [!NOTE] * > This methods writes bytes synchronously; it's provided for compatibility * > with the code Writer interface. * * @example Usage * ```ts * import { Buffer } from "@std
(p: Uint8Array)
| 336 | * @returns The number of bytes written. |
| 337 | */ |
| 338 | write(p: Uint8Array): Promise<number> { |
| 339 | const n = this.writeSync(p); |
| 340 | return Promise.resolve(n); |
| 341 | } |
| 342 | |
| 343 | #grow(n: number) { |
| 344 | const m = this.length; |