Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8193475

Enhance Buffer equals/compareTo

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • None
    • core-libs
    • None

      The buffer equals and compareTo can be enhanced to accept absolute positions for both buffers thereby avoid the duplicate.pos.limit.slice dance.

      Furthermore, the specification of the existing methods can be clarified with respect to when one buffer is a proper prefix of another buffer.

      Mismatch methods can be added to enable flexibility in comparison. The mismatch for floating point values will be compatible with that of arrays (notable the difference between arrays and buffer comparison is the latter states -0 and +0 are equal).

      It may make sense for the absolute comparisons to be supported by static methods, say in a Buffers class.

            psandoz Paul Sandoz
            psandoz Paul Sandoz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: