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.
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.
- relates to
-
JDK-8202216 (bf) Add Buffer mismatch()
-
- Resolved
-
-
JDK-8193085 Vectorize the nio Buffer equals and compareTo implementations
-
- Resolved
-