code: private void appendToBuf(char[] ch, int start, int end) {
          if (start == end) {
              return;
          }
          int neededBufLen = pos + (end - start);
          if (neededBufLen > buf.length) {
              char[] newBuf = new char[neededBufLen];
              System.arraycopy(buf, 0, newBuf, 0, pos);
              if (bufHolder == null) {
                  bufHolder = buf; // keep the original around
              }
              buf = newBuf;
          }
          System.arraycopy(ch, start, buf, pos, end - start);
          pos += (end - start);
      }
docs: Appends a slice of an UTF-16 code unit array to the internal
  buffer.
  
  @param ch the array from which to copy
  @param start the index of the first element that is copied
  @param end the index of the first element that is not copied