public int compareTo(ShortBuffer otherBuffer) {int compareRemaining = (remaining() < otherBuffer.remaining()) ? remaining(): otherBuffer.remaining();int thisPos = position;int otherPos = otherBuffer.position;short thisByte, otherByte;while (compareRemaining > 0) {thisByte = get(thisPos);otherByte = otherBuffer.get(otherPos);if (thisByte != otherByte) {return thisByte < otherByte ? -1 : 1;}thisPos++;otherPos++;compareRemaining--;}return remaining() - otherBuffer.remaining();}

public int compareTo ( ShortBuffer otherBuffer ) { int compareRemaining = ( remaining ( ) < otherBuffer . remaining ( ) ) ? remaining ( ) : otherBuffer . remaining ( ) ; int thisPos = position ; int otherPos = otherBuffer . position ; short thisByte , otherByte ; while ( compareRemaining > 0 ) { thisByte = get ( thisPos ) ; otherByte = otherBuffer . get ( otherPos ) ; if ( thisByte != otherByte ) { return thisByte < otherByte ? - 1 : 1 ; } thisPos ++ ; otherPos ++ ; compareRemaining -- ; } return remaining ( ) - otherBuffer . remaining ( ) ; }
public virtual int compareTo(java.nio.ShortBuffer otherBuffer){int compareRemaining = (remaining() < otherBuffer.remaining()) ? remaining() : otherBuffer.remaining();int thisPos = _position;int otherPos = otherBuffer._position;short thisByte;short otherByte;while (compareRemaining > 0){thisByte = get(thisPos);otherByte = otherBuffer.get(otherPos);if (thisByte != otherByte){return thisByte < otherByte ? -1 : 1;}thisPos++;otherPos++;compareRemaining--;}return remaining() - otherBuffer.remaining();}
