text: public virtual int compareTo(java.nio.DoubleBuffer otherBuffer){int compareRemaining = (remaining() < otherBuffer.remaining()) ? remaining() : otherBuffer.remaining();int thisPos = _position;int otherPos = otherBuffer._position;double thisDouble;double otherDouble;while (compareRemaining > 0){thisDouble = get(thisPos);otherDouble = otherBuffer.get(otherPos);if ((thisDouble != otherDouble) && ((thisDouble == thisDouble) || (otherDouble ==otherDouble))){return thisDouble < otherDouble ? -1 : 1;}thisPos++;otherPos++;compareRemaining--;}return remaining() - otherBuffer.remaining();}