node
node copied to clipboard
`Writable.write(buf, sourceOffset, sourceLength)`
I want to add a Writable.write(sourceBuf, sourceOffset, sourceLength)
API to Writable
to get a bit of extra performance in the following case:
writable.write(buf.subarray(offset, length))
The subarray
call (particularly regarding allocating Buffer
) can be quite slow and avoided in this API. Hence I would like to be able to do something like:
writable.write(buf, offset, length)
I'm not sure how the API should look, though, or whether adding another signature to write
would break anyone.
Internally stream implementation would need to explicitly support this by implementing something like _writeSlice
and _writevSlice