public Position createBiasPosition(int offset, Position.Bias bias) throws BadLocationException {
   checkOffset(offset);
   BasePosition pos = new BasePosition();
   //        registerStack(pos);
   markVector.insert(markVector.createBiasMark(pos, offset, bias));
   return pos;
 }
  void compact() {
    if (gapLength > 0) {
      int newLength = charArray.length - gapLength;
      char[] newCharArray = new char[newLength];
      int gapEnd = gapStart + gapLength;
      System.arraycopy(charArray, 0, newCharArray, 0, gapStart);
      System.arraycopy(charArray, gapEnd, newCharArray, gapStart, charArray.length - gapEnd);
      charArray = newCharArray;
      gapStart = charArray.length;
      gapLength = 0;
    }

    markVector.compact();
  }
 @Override
 public String toString() {
   return "charArray.length=" + charArray.length + ", " + markVector.toString();
 }
 MultiMark createMark(int offset) throws BadLocationException {
   checkOffset(offset);
   return markVector.insert(markVector.createMark(offset));
 }
 MultiMark createBiasMark(int offset, Position.Bias bias) throws BadLocationException {
   checkOffset(offset);
   return markVector.insert(markVector.createBiasMark(offset, bias));
 }