txt.array = new char[len];
int length = length(); 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);
  public void getChars(int where, int len, Segment txt)    throws BadLocationException    {	txt.array = new char[len];		    System.arraycopy(buf.toString().toCharArray(), where, txt.array, 0, len);		txt.count  = len;	txt.offset = 0;    }