public int compareTo ( IntBuffer otherBuffer ) { int compareRemaining = ( remaining ( ) < otherBuffer . remaining ( ) ) ? remaining ( ) : otherBuffer . remaining ( ) ; int thisPos = position ; int otherPos = otherBuffer . position ; // BEGIN android-changed int thisInt , otherInt ; while ( compareRemaining > 0 ) { thisInt = get ( thisPos ) ; otherInt = otherBuffer . get ( otherPos ) ; if ( thisInt != otherInt ) { return thisInt < otherInt ? - 1 : 1 ; } thisPos ++ ; otherPos ++ ; compareRemaining -- ; } // END android-changed return remaining ( ) - otherBuffer . remaining ( ) ; }
Compares the remaining ints of this buffer to another int buffer s remaining ints .