bnoordhuis/node-buffertools — Issue #15: optional offset parameters for some methods
Author: ZoltanLajosKis
Created: 2011-11-23 18:52:18+00:00
State: open

Would it be possible to extend the following methods with an optional "offset" parameter? By default the parameter would take the value '0', and would behave exactly as of now, thus staying backward compatible. Something like:

* Buffer.compare(buffer|string, thatOffset = 0, thisOffset = 0):
compares this buffer starting at thisOffset till end to the given buffer/string starting at thatOffset.

* Buffer.indexOf(buffer|string, thisOffset = 0):
Search this buffer for the first occurrence of the given buffer, starting from thisOffset.

* Buffer.equals(buffer|string, thisOffset = 0, length = buffer.length):
checks if the given buffer equals to this buffer, starting from thisOffset, on the first length bytes.

Thanks.