code: public void getChars(int start, int end, char[] dest, int destoff) {
          checkRange("getChars", start, end);
  
          if (end <= mGapStart) {
              System.arraycopy(mText, start, dest, destoff, end - start);
          } else if (start >= mGapStart) {
              System.arraycopy(mText, start + mGapLength, dest, destoff, end - start);
          } else {
              System.arraycopy(mText, start, dest, destoff, mGapStart - start);
              System.arraycopy(mText, mGapStart + mGapLength,
                      dest, destoff + (mGapStart - start),
                      end - mGapStart);
          }
      }
docs: Copy the specified range of chars from this buffer into the
  specified array, beginning at the specified offset.