public int compareTo(FloatBuffer otherBuffer){
  int compareRemaining=(remaining() < otherBuffer.remaining()) ? remaining() : otherBuffer.remaining();
  int thisPos=position;
  int otherPos=otherBuffer.position;
  float thisFloat, otherFloat;
  while (compareRemaining > 0) {
    thisFloat=get(thisPos);
    otherFloat=otherBuffer.get(otherPos);
    if ((thisFloat != otherFloat) && ((thisFloat == thisFloat) || (otherFloat == otherFloat))) {
      return thisFloat < otherFloat ? -1 : 1;
    }
    thisPos++;
    otherPos++;
    compareRemaining--;
  }
  return remaining() - otherBuffer.remaining();
}

public int compareTo ( FloatBuffer otherBuffer ) { int compareRemaining = ( remaining ( ) < otherBuffer . remaining ( ) ) ? remaining ( ) : otherBuffer . remaining ( ) ; int thisPos = position ; int otherPos = otherBuffer . position ; float thisFloat , otherFloat ; while ( compareRemaining > 0 ) { thisFloat = get ( thisPos ) ; otherFloat = otherBuffer . get ( otherPos ) ; if ( ( thisFloat != otherFloat ) && ( ( thisFloat == thisFloat ) || ( otherFloat == otherFloat ) ) ) { return thisFloat < otherFloat ? - 1 : 1 ; } thisPos ++ ; otherPos ++ ; compareRemaining -- ; } return remaining ( ) - otherBuffer . remaining ( ) ; }
compare the remaining floats of this buffer to another float buffer ' s remaining floats .
