code: public String contentsAsString()
      {
          if (mResultString == null) {
              // Has array been requested? Can make a shortcut, if so:
              if (mResultArray != null) {
                  mResultString = new String(mResultArray);
              } else {
                  // Do we use shared array?
                  if (mInputStart >= 0) {
                      if (mInputLen < 1) {
                          return (mResultString = "");
                      }
                      mResultString = new String(mInputBuffer, mInputStart, mInputLen);
                  } else { // nope... need to copy
                      // But first, let's see if we have just one buffer
                      int segLen = mSegmentSize;
                      int currLen = mCurrentSize;
                      
                      if (segLen == 0) { // yup
                          mResultString = (currLen == 0) ? "" : new String(mCurrentSegment, 0, currLen);
                      } else { // no, need to combine
                          StringBuilder sb = new StringBuilder(segLen + currLen);
                          // First stored segments
                          if (mSegments != null) {
                              for (int i = 0, len = mSegments.size(); i < len; ++i) {
                                  char[] curr = mSegments.get(i);
                                  sb.append(curr, 0, curr.length);
                              }
                          }
                          // And finally, current segment:
                          sb.append(mCurrentSegment, 0, mCurrentSize);
                          mResultString = sb.toString();
                      }
                  }
              }
          }
          return mResultString;
      }
docs: /*
  ////////////////////////////////////////////
  Accessors:
  ////////////////////////////////////////////