Skip to content

optional offset parameters for some methods #15

@ZoltanLajosKis

Description

@ZoltanLajosKis

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions