Beispiel #1
0
 public void getChars(int where, int len, Segment txt) throws BadLocationException {
   CharBuffer b = buffer;
   int start = b.getSegment(where, len);
   if (start < 0) throw new BadLocationException("invalid offset", where);
   txt.offset = start;
   txt.array = b.getArray();
   txt.count = len;
 }
Beispiel #2
0
 public String getString(int where, int len) throws BadLocationException {
   CharBuffer b = buffer;
   int start = b.getSegment(where, len);
   if (start < 0) throw new BadLocationException("invalid offset", where);
   return new String(b.getArray(), start, len);
 }