if (where < gapStart)
  public void getChars(int where, int len, Segment txt)      throws BadLocationException  {    // check arguments    int length = length();    if (where < 0)      throw new BadLocationException("the where argument may not be below zero", where);    if (where >= length)      throw new BadLocationException("the where argument cannot be greater"          + " than the content length", where);    if ((where + len) > length)      throw new BadLocationException("len plus where cannot be greater"          + " than the content length", len + where);    // check if requested segment is contiguous    if ((where < gapStart) && ((gapStart - where) < len))    {      // requested segment is not contiguous -> copy the pieces together      char[] copy = new char[len];      int lenFirst = gapStart - where; // the length of the first segment      System.arraycopy(buffer, where, copy, 0, lenFirst);      System.arraycopy(buffer, gapEnd, copy, lenFirst, len - lenFirst);      txt.array = copy;      txt.offset = 0;      txt.count = len;    }    else    {      // requested segment is contiguous -> we can simply return the      // actual content      txt.array = buffer;      if (where < gapStart)        txt.offset = where;      else        txt.offset = where + (gapEnd - gapStart);      txt.count = len;    }  }