public int compareTo ( FloatBuffer otherBuffer ) { int compareRemaining = ( remaining ( ) < otherBuffer . remaining ( ) ) ? remaining ( ) : otherBuffer . remaining ( ) ; int thisPos = position ; int otherPos = otherBuffer . position ; // BEGIN android-changed float thisFloat , otherFloat ; while ( compareRemaining > 0 ) { thisFloat = get ( thisPos ) ; otherFloat = otherBuffer . get ( otherPos ) ; // checks for float and NaN inequality if ( ( thisFloat != otherFloat ) && ( ( thisFloat == thisFloat ) || ( otherFloat == otherFloat ) ) ) { return thisFloat < otherFloat ? - 1 : 1 ; } thisPos ++ ; otherPos ++ ; compareRemaining -- ; } // END android-changed return remaining ( ) - otherBuffer . remaining ( ) ; }
Compare the remaining floats of this buffer to another float buffer s remaining floats .