Exemplo n.º 1
0
        private StringBuffer GetBuffer()
        {
            if (_buffer == null)
            {
                _buffer = new StringBuffer(1025);
            }
            else
            {
                _buffer.Position = 0;
            }

            return _buffer;
        }
Exemplo n.º 2
0
 private void EnsureBufferNotEmpty()
 {
     if (_stringBuffer.IsEmpty)
     {
         _stringBuffer = new StringBuffer(_arrayPool, 1024);
     }
 }
Exemplo n.º 3
0
        private void WriteCharToBuffer(StringBuffer buffer, char writeChar, int lastWritePosition, int writeToPosition)
        {
            if (writeToPosition > lastWritePosition)
            {
                buffer.Append(_chars, lastWritePosition, writeToPosition - lastWritePosition);
            }

            buffer.Append(writeChar);
        }