/* (non-Javadoc)
@see com.ibm.ws.jsp.JSPStrBuffer#getChars(int, int, char[], int)
163048
public void getChars(int start, int end, char[] buffer, int index) {
		sb.getChars(start, end, buffer, index);
	}
88375
@Override
	public char[] getTextCharacters(int[] poslen) {
		String text = getText();
		if (text == null) {
			poslen[0] = -1;
			poslen[1] = -1;
			return null;
		}
		char[] result = text.toCharArray();
		poslen[0] = 0;
		poslen[1] = result.length;
		return result;
	}
1109665
public static int toChars(int i, char[] buf, int offset) {
        if (i < 0) {
            if (i == Integer.MIN_VALUE) {
                writeMinInteger(buf, offset);
                return offset + 11;
            }
            buf[offset++] = '-';
            i = -i;
        }

        offset += stringSizeOf(i);
        getChars(i, offset, buf);
        return offset;
    }
1151199
static CharInput asCharInput(final CharSequence chars) {
    checkNotNull(chars);
    return new CharInput() {
      int index = 0;

      @Override
      public int read() {
        if (index < chars.length()) {
          return chars.charAt(index++);
        } else {
          return -1;
        }
      }

      @Override
      public void close() {
        index = chars.length();
      }
    };
  }
488677
@SuppressWarnings("unchecked")
    public String getCharSet() {
        ParameterParser parser = new ParameterParser();
        parser.setLowerCaseNames(true);
        // Parameter parser can handle null input
        Map<String, String> params = parser.parse(getContentType(), ';');
        return params.get("charset");
    }
1191403
public char[] getPasswordChars()
  {
    if (_password != null)
    {
      if (_password.length != 0)
      {
        char[] result = new char[_password.length];
        System.arraycopy(_password,0,result,0,_password.length);
        return result;
      }
      else
      {
        return _password; // Can safely return the empty array - caller can't change it!
      }
    }
    else
    {
      return null;
    }
  }
47341
public static Characters of(String chars) {
        return StringUtils.isEmpty(chars) ? Characters.NONE : new Characters(false, chars.toCharArray());
    }
1282372
public static char[] bytes2Chars(final byte[] bytes) {
        if (bytes == null) return null;
        int len = bytes.length;
        if (len <= 0) return null;
        char[] chars = new char[len];
        for (int i = 0; i < len; i++) {
            chars[i] = (char) (bytes[i] & 0xff);
        }
        return chars;
    }
713101
private char stringChar() throws JsonParserException {
    int c = advanceChar();
    if (c == -1)
      throw createParseException(null, "String was not terminated before end of input", true);
    if (c < 32)
      throw createParseException(null,
          "Strings may not contain control characters: 0x" + Integer.toString(c, 16), false);
    return (char)c;
  }
326981
public static String[] charArrayToStringArray(char[][] charArrays)
	{
		if (charArrays == null)
		{
			return null;
		}
		int length = charArrays.length;
		if (length == 0)
		{
			return NO_STRINGS;
		}
		String[] strings = new String[length];
		for (int i = 0; i < length; i++)
		{
			strings[i] = new String(charArrays[i]);
		}
		return strings;
	}
216338
public static int search(CharSequence chars, char c) {
        int count = 0;
        for (int i = 0; i < chars.length(); i++) {
            if (chars.charAt(i) == c) {
                count++;
            }
        }
        return count;
    }
909451
public void getChars(int start, int end, char[] dest, int destoff) {
        checkRange("getChars", start, end);

        if (end <= mGapStart) {
            System.arraycopy(mText, start, dest, destoff, end - start);
        } else if (start >= mGapStart) {
            System.arraycopy(mText, start + mGapLength, dest, destoff, end - start);
        } else {
            System.arraycopy(mText, start, dest, destoff, mGapStart - start);
            System.arraycopy(mText, mGapStart + mGapLength,
                    dest, destoff + (mGapStart - start),
                    end - mGapStart);
        }
    }
303464
public static char getChar(MemorySegment[] segments, int offset) {
		if (inFirstSegment(segments, offset, 2)) {
			return segments[0].getChar(offset);
		} else {
			return getCharMultiSegments(segments, offset);
		}
	}
79559
protected function getChars(array $strings)
	{
		$chars = [];
		foreach ($strings as $k => $string)
		{
			if ($this->isChar($string))
			{
				$chars[$k] = $string[0];
			}
		}

		return $chars;
	}
1173660
@SuppressWarnings("PMD.UseVarargs")
    public static char[] toChars(final byte[] bytes) {

        // make sure we can handle null inputs
        if (bytes == null) {
            return toChars(new byte[0], Charset.defaultCharset().name());
        } else {
            return toChars(bytes, Charset.defaultCharset().name());
        }
    }
693147
@Override
    protected final char nextChar() {
        if (currentChar != 0) {
            char ch = currentChar;
            this.currentChar = 0;
            return ch;
        }
        if (this.currentBuffer != null) {
            int remain = this.currentBuffer.remaining();
            if (remain == 0 && this.currentIndex + 1 >= this.buffers.length) return 0;
        }
        byte b1 = nextByte();
        if (b1 >= 0) {// 1 byte, 7 bits: 0xxxxxxx
            return (char) b1;
        } else if ((b1 >> 5) == -2 && (b1 & 0x1e) != 0) { // 2 bytes, 11 bits: 110xxxxx 10xxxxxx
            return (char) (((b1 << 6) ^ nextByte()) ^ (((byte) 0xC0 << 6) ^ ((byte) 0x80)));
        } else if ((b1 >> 4) == -2) { // 3 bytes, 16 bits: 1110xxxx 10xxxxxx 10xxxxxx
            return (char) ((b1 << 12) ^ (nextByte() << 6) ^ (nextByte() ^ (((byte) 0xE0 << 12) ^ ((byte) 0x80 << 6) ^ ((byte) 0x80))));
        } else { // 4 bytes, 21 bits: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
            throw new RuntimeException(new UnmappableCharacterException(4));
        }
    }
156256
public void characters(char ch[], int start, int length)
    {
        if (m_CurrentString == null)
            m_CurrentString = new String(ch, start, length);
        else
            m_CurrentString += new String(ch, start, length);
    }