Prepends the characters of {@code newBuffer} to be read before the
current buffer.
168192
private void pushContentSource(char[] newBuffer) {
        nextContentSource = new ContentSource(nextContentSource, buffer, position, limit);
        buffer = newBuffer;
        position = 0;
        limit = newBuffer.length;
    }
132057
protected void wrapBuffer()
        throws IOException
    {
        // Handle chunking
        int size=size();
        if (_chunking && size()>0)
        {
            prewrite(__CRLF,0,__CRLF.length);
            while (size>0)
            {
                int d=size%16;
                if (d<=9)
                    prewrite('0'+d);
                else
                    prewrite('a'-10+d);
                size=size/16;
            }
            postwrite(__CRLF,0,__CRLF.length);
        }
        
        // Complete it if we must.
        if (_complete && !_completed)
        {
            _completed=true;
            if (_chunking)
                postwrite(__CHUNK_EOF,0,__CHUNK_EOF.length);
        }
    }
845732
private int _prependOrWriteCharacterEscape(char[] buffer, int ptr, int end,
											   char ch, int escCode)
			throws IOException, JsonGenerationException
	{
		if (escCode >= 0) { // \\N (2 char)
			if (ptr > 1 && ptr < end) { // fits, just prepend
				ptr -= 2;
				buffer[ptr] = '\\';
				buffer[ptr+1] = (char) escCode;
			} else { // won't fit, write
				char[] ent = _entityBuffer;
				if (ent == null) {
					ent = _allocateEntityBuffer();
				}
				ent[1] = (char) escCode;
				_writer.write(ent, 0, 2);
			}
			return ptr;
		}
		if (escCode != CharacterEscapes.ESCAPE_CUSTOM) { // std, \\uXXXX
			if (ptr > 5 && ptr < end) { // fits, prepend to buffer
				ptr -= 6;
				buffer[ptr++] = '\\';
				buffer[ptr++] = 'u';
				// We know it's a control char, so only the last 2 chars are non-0
				if (ch > 0xFF) { // beyond 8 bytes
					int hi = (ch >> 8) & 0xFF;
					buffer[ptr++] = HEX_CHARS[hi >> 4];
					buffer[ptr++] = HEX_CHARS[hi & 0xF];
					ch &= 0xFF;
				} else {
					buffer[ptr++] = '0';
					buffer[ptr++] = '0';
				}
				buffer[ptr++] = HEX_CHARS[ch >> 4];
				buffer[ptr] = HEX_CHARS[ch & 0xF];
				ptr -= 5;
			} else {
				// won't fit, flush and write
				char[] ent = _entityBuffer;
				if (ent == null) {
					ent = _allocateEntityBuffer();
				}
				_outputHead = _outputTail;
				if (ch > 0xFF) { // beyond 8 bytes
					int hi = (ch >> 8) & 0xFF;
					int lo = ch & 0xFF;
					ent[10] = HEX_CHARS[hi >> 4];
					ent[11] = HEX_CHARS[hi & 0xF];
					ent[12] = HEX_CHARS[lo >> 4];
					ent[13] = HEX_CHARS[lo & 0xF];
					_writer.write(ent, 8, 6);
				} else { // We know it's a control char, so only the last 2 chars are non-0
					ent[6] = HEX_CHARS[ch >> 4];
					ent[7] = HEX_CHARS[ch & 0xF];
					_writer.write(ent, 2, 6);
				}
			}
			return ptr;
		}
		String escape;
		if (_currentEscape == null) {
			escape = _characterEscapes.getEscapeSequence(ch).getValue();
		} else {
			escape = _currentEscape.getValue();
			_currentEscape = null;
		}
		int len = escape.length();
		if (ptr >= len && ptr < end) { // fits in, prepend
			ptr -= len;
			escape.getChars(0, len, buffer, ptr);
		} else { // won't fit, write separately
			_writer.write(escape);
		}
		return ptr;
	}
1336416
private void preprocess(IoBuffer pat) {
    this.b = new int[256];
    this.lim = 0;
    for (int i = 0; i < 256; i++) {
      this.b[i] = ~0;

    }
    for (int i = 0, j = 1; i < this.patternLen; i++, j <<= 1) {
      this.b[ByteBufferUtils.uByte(pat.get(i))] &= ~j;
      this.lim |= j;
    }
    this.lim = ~(this.lim >> 1);

  }
1215723
private void dataBufferAppend(char[] ch, int start, int length) {
        dataBuffer = (char[]) extendArray(dataBuffer, dataBuffer.length,
                dataBufferPos + length);

        System.arraycopy(ch, start, dataBuffer, dataBufferPos, length);
        dataBufferPos += length;
    }
1021630
void initNewBuffer(Writer out, int bufSize)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        { // 306998.15
            Tr.debug(tc, "initNewBuffer, size --> " + bufSize + " this --> " + this);
        }
        this.out = out;
        this.except = null;
        bufferSize = bufSize;
        buf = new char[bufferSize];
    }
1254512
public StrBuilder appendPadding(final int length, final char padChar) {
        if (length >= 0) {
            ensureCapacity(size + length);
            for (int i = 0; i < length; i++) {
                buffer[size++] = padChar;
            }
        }
        return this;
    }
1237395
private final void appendContents(StringBuffer buf,
                                      CharacterIterator iterator) {
        int index = iterator.getBeginIndex();
        int end = iterator.getEndIndex();

        while (index < end) {
            iterator.setIndex(index++);
            buf.append(iterator.current());
        }
    }
468713
public static void append(StringBuilder buf, String s, int offset, int length) {
        synchronized (buf) {
            int end = offset + length;
            for (int i = offset; i < end; i++) {
                if (i >= s.length())
                    break;
                buf.append(s.charAt(i));
            }
        }
    }
155241
private void fillBuffer() throws IOException {
        if (!endOfInput && (lastCoderResult == null || lastCoderResult.isUnderflow())) {
            encoderIn.compact();
            int position = encoderIn.position();
            // We don't use Reader#read(CharBuffer) here because it is more efficient
            // to write directly to the underlying char array (the default implementation
            // copies data to a temporary char array).
            int c = reader.read(encoderIn.array(), position, encoderIn.remaining());
            if (c == -1) {
                endOfInput = true;
            } else {
                encoderIn.position(position + c);
            }
            encoderIn.flip();
        }
        encoderOut.compact();
        lastCoderResult = encoder.encode(encoderIn, encoderOut, endOfInput);
        encoderOut.flip();
    }
914276
public void append(final StringBuffer sb) {
        if (sb == null) {
            return;
        }
        provideCapacity(length + sb.length());
        sb.getChars(0, sb.length(), c, length);
        length += sb.length();
    }
317072
private void appendReadParameters(StringBuffer pRet) {
        if (isMultiAttributeMode()) {
            pRet.append("attribute=[");
            for (int i = 0;i<attributeNames.size();i++) {
                pRet.append(attributeNames.get(i));
                if (i < attributeNames.size() - 1) {
                    pRet.append(",");
                }
            }
            pRet.append("]");
        } else {
            pRet.append("attribute=").append(getAttributeName());
        }
    }
394903
function CustomBuffer(existingBuffer) {
    var buffer = existingBuffer || new Buffer(48);
    var offset = 0;

    this.writeVarInt = function(val) {
        while (true) {
            if ((val & 0xFFFFFF80) == 0) {
                this.writeUByte(val);

                return;
            }

            this.writeUByte(val & 0x7F | 0x80);

            val = val >>> 7;
        }
    };

    this.writeString = function(string) {
        this.writeVarInt(string.length);

        if (offset + string.length >= buffer.length) {
            Buffer.concat([buffer, new Buffer(string.length)]);
        }

        buffer.write(string, offset, string.length, "UTF-8");

        offset += string.length;
    };

    this.writeUShort = function(val) {
        this.writeUByte(val >> 8);
        this.writeUByte(val & 0xFF);
    };

    this.writeUByte = function(val) {
        if (offset + 1 >= buffer.length) {
            Buffer.concat([buffer, new Buffer(50)]);
        }

        buffer.writeUInt8(val, offset++);
    };

    this.readVarInt = function() {
        var val = 0;
        var count = 0;

        while (true) {
            var i = buffer.readUInt8(offset++);

            val |= (i & 0x7F) << count++ * 7;

            if ((i & 0x80) != 128) {
                break
            }
        }

        return val;
    };

    this.readString = function() {
        var length = this.readVarInt();
        var str = buffer.toString("UTF-8", offset, offset + length);

        offset += length;
        
        return str;
    };

    this.buffer = function() {
        return buffer.slice(0, offset);
    };

    this.offset = function() {
        return offset;
    };
}
1292987
public IStringBuffer append( char c )
    {
        if ( count == buff.length ) {
            resizeTo( buff.length * 2 + 1 );
        }
        
        buff[count++] = c;
        
        return this;
    }
625148
private void newBuffer(int offset) {
    if (maxBufferSize >= 0) {
      buffer = new int[maxBufferSize];
      isByte = new boolean[maxBufferSize];
      bufferOffset = offset;
      currentBufferSize = 0;
    }
  }
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;
    }
661869
public JSPStrBuffer append(char[] chars, int start, int length) {
		sb.append(chars, start, length);
		return this;
	}