* Reads data from the file into multiple buffers. * @param {Buffer[]} buffers The buffers to read into * @param {number|null} [position] The position to read from * @returns {Promise<{ bytesRead: number, buffers: Buffer[] }>}
(buffers, position)
| 273 | * @returns {Promise<{ bytesRead: number, buffers: Buffer[] }>} |
| 274 | */ |
| 275 | async readv(buffers, position) { |
| 276 | this.#checkClosed('readv'); |
| 277 | let totalRead = 0; |
| 278 | for (let i = 0; i < buffers.length; i++) { |
| 279 | const buf = buffers[i]; |
| 280 | const pos = position != null ? position + totalRead : null; |
| 281 | const { bytesRead } = await this.read(buf, 0, buf.byteLength, pos); |
| 282 | totalRead += bytesRead; |
| 283 | if (bytesRead < buf.byteLength) break; |
| 284 | } |
| 285 | return { __proto__: null, bytesRead: totalRead, buffers }; |
| 286 | } |
| 287 | |
| 288 | /** |
| 289 | * Writes data from multiple buffers to the file. |
nothing calls this directly
no test coverage detected