protected void resize(int len) {
    char newbuf[] = new char[Math.max(buf.length << 1, len)];
    System.arraycopy(buf, 0, newbuf, 0, size());
    buf = newbuf;
  }
A StringBuilder that allows one to access the array.
linguistics/src/main/java/com/yahoo/language/simple/kstem/OpenStringBuilder.java