code: public Object getPos(Object p) {
          if (p == null) {
              return new Object[] {buf, new int[] {pos.getIndex(), bufPos}};
          }
          Object[] a = (Object[]) p;
          a[0] = buf;
          int[] v = (int[]) a[1];
          v[0] = pos.getIndex();
          v[1] = bufPos;
          return p;
      }
docs: Returns an object which, when later passed to setPos(), will
  restore this iterator's position.  Usage idiom:
  
  RuleCharacterIterator iterator = ...;
  Object pos = iterator.getPos(null); // allocate position object
  for (;;) {
  pos = iterator.getPos(pos); // reuse position object
  int c = iterator.next(...);
  ...
  }
  iterator.setPos(pos);
  
  @param p a position object previously returned by getPos(),
  or null.  If not null, it will be updated and returned.  If
  null, a new position object will be allocated and returned.
  @return a position object which may be passed to setPos(),
  either `p,' or if `p' == null, a newly-allocated object