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
507834
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);
    }
1337060
public void add(char ch) {
    if (b.length <= i + EXTRA) {
      char[] new_b = new char[b.length+INC];
      for (int c = 0; c < b.length; c++)
        new_b[c] = b[c];
      b = new_b;
    }
    b[i++] = ch;
  }
548019
@Override
    public void characters (char ch[], int start, int len) {
        while (len > 0 && Character.isWhitespace(ch[start])) {
            ++start;
            --len;
        }
        while (len > 0 && Character.isWhitespace(ch[start+len-1])) {
            --len;
        }
        if (_text.length() > 0) {
            _text.append(' ');
        }
        _text.append(ch, start, len);
    }
1303723
private static int copyPathFragment(char[] input, int beginIndex, StringBuilder output)
	{
		int inputCharIndex = beginIndex;
		while (inputCharIndex < input.length)
		{
			final char inputChar = input[inputCharIndex];
			if (inputChar == '/')
			{
				break;
			}

			output.append(inputChar);
			inputCharIndex += 1;
		}

		return inputCharIndex;
	}
382395
final protected void putChar(char c) {
        final int clen = _internalBuffer.length;
        if (clen == _bufferPosition) {
            final char[] next = new char[2 * clen + 1];

            System.arraycopy(_internalBuffer, 0, next, 0, _bufferPosition);
            _internalBuffer = next;
        }

        _internalBuffer[_bufferPosition++] = c;
    }
928628
public void characters(char[] ch, int start, int length)
	    throws SAXException {
	if (isAccepted())
	    getContentHandler().characters(ch, start, length);
    }
19910
public static void appendMailto (final StringBuilder out, final String in, final int start, final int end)
  {
    for (int i = start; i < end; i++)
    {
      final char c = in.charAt (i);
      final int r = rnd ();
      switch (c)
      {
        case '&':
        case '<':
        case '>':
        case '"':
        case '\'':
        case '@':
          if (r < 512)
            _appendDecEntity (out, c);
          else
            _appendHexEntity (out, c);
          break;
        default:
          if (r < 32)
            out.append (c);
          else
            if (r < 520)
              _appendDecEntity (out, c);
            else
              _appendHexEntity (out, c);
          break;
      }
    }
  }
265669
public byte[] toByteArray(int start, int end) {
        return Arrays.copyOfRange(value, start + offset, end + offset);
    }
313145
public Appendable append(StringValue csq, int start, int end) {
		final int otherLen = end - start;
		grow(this.len + otherLen);
		System.arraycopy(csq.value, start, this.value, this.len, otherLen);
		this.len += otherLen;
		return this;
	}
685114
public void characters(char[] ch, int start, int length) {

        if (ignore)
            return;

        String content = new String(ch, start, length);
        // System.err.println("'" + content + "'");

        if (content.trim().length() == 0 && content.indexOf(' ') < 0) {
            return;
        }

        StringBuffer buf = new StringBuffer();
        int len = content.length();
        char character;
        boolean newline = false;
        for (int i = 0; i < len; i++) {
            switch (character = content.charAt(i)) {
            case ' ':
                if (!newline) {
                    buf.append(character);
                }
                break;
            case '\n':
                if (i > 0) {
                    newline = true;
                    buf.append(' ');
                }
                break;
            case '\r':
                break;
            case '\t':
                break;
            default:
                newline = false;
                buf.append(character);
            }
        }
        if (currentChunk == null) {
        	if (bf == null) {
        		currentChunk = new Chunk(buf.toString());
        	}
        	else {
        		currentChunk = new Chunk(buf.toString(), new Font(this.bf));
        	}
        } else {
            currentChunk.append(buf.toString());
        }
    }
717674
public void append(final byte[] data, final int start, final int len) {
		final int oldLength = this.bytes.length;
		setCapacity(this.bytes.length + len, true);
		System.arraycopy(data, start, this.bytes, oldLength, len);
	}
393443
public static boolean endsWithChar(String str, char ch) {
        if (StringUtils.isEmpty(str)) {
            return false;
        }

        return str.charAt(str.length() - 1) == ch;
    }
1271589
public void characters(char[] ch, int start, int length) throws SAXException
    {
        if (startTable)
        {
            try {
                String string = new String(ch, start, length);
                for (int i = string.length() - 1; i >= 0; i--)
                {   // Trim trailing spaces
                    int x = Character.getNumericValue(string.charAt(i));
                    if ((Character.isWhitespace(string.charAt(i))) || (x == -1))
                        string = string.substring(0, string.length() - 1);
                    else
                        break;
                }
                if (row == 0)
                {
                    new StringField(m_record, string, -1, string, null);
                }
                else
                {
                    if (col == 0)
                    {
                        if (m_record.getEditMode() == DBConstants.EDIT_ADD)
                            m_record.add();
                        m_record.addNew();
                    }
                    m_record.getField(col + 1).setString(string);
                }
            } catch (DBException e) {
                e.printStackTrace();
            }
        }
    }
1093930
public MarkdownDocStream append(CharSequence p, int start, int end) {
    for(int pos = start; pos < end; ++pos) {
      final char c = p.charAt(pos);
      if(c == '\r') {
        continue;
      }
      append(c); // Uses \n magic.
    }
    return this;
  }
185539
@Override
    public StrBuilder append(final char ch) {
        final int len = length();
        ensureCapacity(len + 1);
        buffer[size++] = ch;
        return this;
    }
329971
public int lastIndexOf(final char ch, int startIndex) {
        startIndex = (startIndex >= size ? size - 1 : startIndex);
        if (startIndex < 0) {
            return -1;
        }
        for (int i = startIndex; i >= 0; i--) {
            if (buffer[i] == ch) {
                return i;
            }
        }
        return -1;
    }
163048
public void getChars(int start, int end, char[] buffer, int index) {
		sb.getChars(start, end, buffer, index);
	}