* Reads data from the file. * @param {Buffer} buffer The buffer to read into * @param {number} offset The offset in the buffer to start writing * @param {number} length The number of bytes to read * @param {number|null} position The position to read from (null uses current position) *
(buffer, offset, length, position)
| 495 | * @returns {Promise<{ bytesRead: number, buffer: Buffer }>} |
| 496 | */ |
| 497 | async read(buffer, offset, length, position) { |
| 498 | const bytesRead = this.readSync(buffer, offset, length, position); |
| 499 | return { __proto__: null, bytesRead, buffer }; |
| 500 | } |
| 501 | |
| 502 | /** |
| 503 | * Writes data to the file synchronously. |