(self, data, cb)
| 119 | } |
| 120 | |
| 121 | function writevGeneric(self, data, cb) { |
| 122 | const req = createWriteWrap(self[kHandle], cb); |
| 123 | const allBuffers = data.allBuffers; |
| 124 | let chunks; |
| 125 | if (allBuffers) { |
| 126 | chunks = data; |
| 127 | for (let i = 0; i < data.length; i++) |
| 128 | data[i] = data[i].chunk; |
| 129 | } else { |
| 130 | chunks = new Array(data.length << 1); |
| 131 | for (let i = 0; i < data.length; i++) { |
| 132 | const entry = data[i]; |
| 133 | chunks[i * 2] = entry.chunk; |
| 134 | chunks[i * 2 + 1] = entry.encoding; |
| 135 | } |
| 136 | } |
| 137 | const err = req.handle.writev(req, chunks, allBuffers); |
| 138 | |
| 139 | // Retain chunks |
| 140 | if (err === 0) req._chunks = chunks; |
| 141 | |
| 142 | afterWriteDispatched(req, err, cb); |
| 143 | return req; |
| 144 | } |
| 145 | |
| 146 | function writeGeneric(self, data, encoding, cb) { |
| 147 | const req = createWriteWrap(self[kHandle], cb); |
no test coverage detected
searching dependent graphs…