code: public TextRange newRange(int startOffset, int endOffset) {
      checkMetadata();
      return newRangeValidPointers(newPointer(startOffset), newPointer(endOffset), false);
    }
docs: Create Range from global offsets. Used for backward compatibility with older API.