Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optional offset parameters for some methods #15

Open
ZoltanLajosKis opened this issue Nov 23, 2011 · 0 comments
Open

optional offset parameters for some methods #15

ZoltanLajosKis opened this issue Nov 23, 2011 · 0 comments

Comments

@ZoltanLajosKis
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant