* Writes data from multiple buffers to the file. * @param {Buffer[]} buffers The buffers to write from * @param {number|null} [position] The position to write to * @returns {Promise<{ bytesWritten: number, buffers: Buffer[] }>}
(buffers, position)
| 292 | * @returns {Promise<{ bytesWritten: number, buffers: Buffer[] }>} |
| 293 | */ |
| 294 | async writev(buffers, position) { |
| 295 | this.#checkClosed('writev'); |
| 296 | let totalWritten = 0; |
| 297 | for (let i = 0; i < buffers.length; i++) { |
| 298 | const buf = buffers[i]; |
| 299 | const pos = position != null ? position + totalWritten : null; |
| 300 | const { bytesWritten } = await this.write(buf, 0, buf.byteLength, pos); |
| 301 | totalWritten += bytesWritten; |
| 302 | if (bytesWritten < buf.byteLength) break; |
| 303 | } |
| 304 | return { __proto__: null, bytesWritten: totalWritten, buffers }; |
| 305 | } |
| 306 | |
| 307 | /** |
| 308 | * Appends data to the file. |
nothing calls this directly
no test coverage detected