* Writes data to the file. * @param {Buffer} buffer The buffer to write from * @param {number} offset The offset in the buffer to start reading * @param {number} length The number of bytes to write * @param {number|null} position The position to write to (null uses current position) *
(buffer, offset, length, position)
| 560 | * @returns {Promise<{ bytesWritten: number, buffer: Buffer }>} |
| 561 | */ |
| 562 | async write(buffer, offset, length, position) { |
| 563 | const bytesWritten = this.writeSync(buffer, offset, length, position); |
| 564 | return { __proto__: null, bytesWritten, buffer }; |
| 565 | } |
| 566 | |
| 567 | /** |
| 568 | * Reads the entire file synchronously. |