在 Java 中比较两个 ByteBuffer 的内容以检查是否相等的最简单方法是什么?
最佳答案
您可以检查 equals()
方法也是。
Tells whether or not this buffer is equal to another object.
Two byte buffers are equal if, and only if,
- They have the same element type,
- They have the same number of remaining elements, and
- The two sequences of remaining elements, considered independently of their starting positions, are pointwise equal.
A byte buffer is not equal to any other type of object.
关于java - 比较 ByteBuffer 的内容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3769891/