code: private void resize(int needSpaceFor) {
          char[] old = mBuffer;
          int oldLen = old.length;
          int addition = oldLen >> 1; // Grow by 50%
          needSpaceFor -= (oldLen - mBufferLen);
          if (addition < needSpaceFor) {
              addition = needSpaceFor;
          }
          mBuffer = new char[oldLen+addition];
          System.arraycopy(old, 0, mBuffer, 0, mBufferLen);
      }
docs: /*
  /////////////////////////////////////////////////////////////////////
  Internal methodss
  /////////////////////////////////////////////////////////////////////