code: public String createString() {
          int i;
          int count;
  
          if (endPageIdx == 0) {
              // speedup the most frequent situation
              return new String(endPage, start, end - start);
          } else {
              char[] buffer;
  
              buffer = new char[endPageIdx * pageSize + end - start];
              count = pageSize - start;
              System.arraycopy(pages.get(0), start, buffer, 0, count);
              for (i = 1; i < endPageIdx; i++) {
                  System.arraycopy(pages.get(i), 0, buffer, count, pageSize);
                  count += pageSize;
              }
              System.arraycopy(pages.get(endPageIdx), 0, buffer, count, end);
              return new String(buffer);
          }
      }
docs: Returns the string between start and the current position.