/*
@see com.ibm.ws.bytebuffer.internal.WsByteBufferImpl#putChar(char[], int, int)
760583
@Override
    public WsByteBuffer putChar(char[] values, int off, int len) {
        convertBufferIfNeeded();
        return super.putChar(values, off, len);
    }
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));
        }
    }
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;
  }
875323
@Override
  public void write (final int c) throws IOException
  {
    _ensureOpen ();
    if (m_nNextChar >= m_nChars)
      flushBuffer ();
    m_aBuf[m_nNextChar++] = (char) c;
  }
916317
public Packer putChar(final char value) {
		ensureCapacity(bufPosition + 2);
		buf[bufPosition++] = (byte) (value >> 8);
		buf[bufPosition++] = (byte) (value);
		return this;
	}
1338085
public void append(final CharBuffer cb) {
        if (cb == null) {
            return;
        }
        provideCapacity(length + cb.length);
        System.arraycopy(cb.c, 0, c, length, cb.length);
        length += cb.length;
    }
349797
public void write(char[] buf) throws IOException {
	    if (writer != null) {
	        writer.write(buf);
	    } else {
	        write(buf, 0, buf.length);
	    }
    }
1298105
private static void writeCharSequence(CharSequence seq, CharBuf buffer) {
        if (seq.length() > 0) {
            buffer.addJsonEscapedString(seq.toString());
        } else {
            buffer.addChars(EMPTY_STRING_CHARS);
        }
    }
959028
public void setCharset(String to) {
    // Validate the character set.
    try {
      new String(new byte[97], to);
    } catch (UnsupportedEncodingException e) {
      throw new RuntimeException(e);
    }
    charset = to;
  }
1369415
public void characters(final char[] ch, final int start, final int length) throws SAXException {
        charBuffer.append(ch, start, length);
    }
651536
@Override
    public void setCharacterEncoding(String charset) {
        if (null != this.outWriter || isCommitted()) {
            return;
        }
        if (null != charset) {
            this.encoding = connection.getEncodingUtils().stripQuotes(charset);
        }
        if (null != this.contentType) {
            int index = this.contentType.indexOf("charset=");
            StringBuilder sb = new StringBuilder();
            if (-1 != index) {
                sb.append(this.contentType.substring(0, index - 1).trim());
            } else {
                sb.append(this.contentType);
            }
            if (this.encoding != null) {
                sb.append(";charset=").append(this.encoding);
            }

            this.contentType = sb.toString();
            this.response.setHeader("Content-Type", this.contentType);
        }
    }
676283
public void putString(int pos, CharSequence s) {
		for (int i = 0; i < s.length(); ++i) {
			char c = s.charAt(i);
			byte b0 = (byte)c;
			byte b1 = (byte)(c >> 8);
			if (_order == ByteOrder.BIG_ENDIAN) {
				putBytes(pos, b1, b0);
			} else {
				putBytes(pos, b0, b1);
			}
			pos += 2;
		}
	}
312666
static void putEntry(final int charsetId, String mysqlCharset, String mysqlCollation, String javaCharset) {
        entries[charsetId] = new Entry(charsetId, mysqlCharset, // NL
            mysqlCollation,
            javaCharset);
    }
1114341
private static char[] mapChar (byte[] digits) {
		char[] result = new char[digits.length];

		for (int i=0; i<digits.length; i++)
			result[i] = mapChar(digits[i]);

		return result;
	}
588376
@Override
    public void insert(char[] text) throws IOException
    {
        int ln = text.length;
        if (ln == 0)
        {
            return;
        }
        if (ln >= size - (end-cursor))
        {
            throw new IOException(Arrays.toString(text)+" doesn't fit in the buffer");
        }
        if (cursor != end)
        {
            makeRoom(ln);
        }
        if (array != null)
        {
            int cms = (int) (cursor % size);
            if (size - cms < text.length)
            {
                System.arraycopy(text, 0, array, cms, size - cms);
                System.arraycopy(text, size - cms, array, 0, text.length - (size - cms));
            }
            else
            {
                System.arraycopy(text, 0, array, cms, text.length);
            }
        }
        else
        {
            for (int ii=0;ii<ln;ii++)
            {
                set(cursor+ii, text[ii]);
            }
        }
        end += ln;
    }
445402
public static void writeString(String s, DataOutputStream out) throws IOException
    {
        out.writeInt(s.length());
        for (char c : s.toCharArray())
        {
            out.writeChar(c);
        }
    }
760643
public void write(int c) throws IOException {
	    if (writer != null) {
	        writer.write(c);
	    } else {
	        ensureOpen();
	        //PK33136
	        strBuffer.append((char)c);
	        ++nextChar;
			//PK33136
	    }
    }