MCPcopy Create free account
hub / github.com/ReadyTalk/avian / compareTo

Method compareTo

classpath/java/nio/ByteBuffer.java:85–95  ·  view source on GitHub ↗
(ByteBuffer o)

Source from the content-addressed store, hash-verified

83 }
84
85 public int compareTo(ByteBuffer o) {
86 int end = (remaining() < o.remaining() ? remaining() : o.remaining());
87
88 for (int i = 0; i < end; ++i) {
89 int d = get(position + i) - o.get(o.position + i);
90 if (d != 0) {
91 return d;
92 }
93 }
94 return remaining() - o.remaining();
95 }
96
97 public boolean equals(Object o) {
98 return o instanceof ByteBuffer && compareTo((ByteBuffer) o) == 0;

Callers 1

equalsMethod · 0.95

Calls 3

getMethod · 0.95
getMethod · 0.65
remainingMethod · 0.45

Tested by

no test coverage detected