private void AddToString(int c)
{
int N = stringBufferTop;
if (N == stringBuffer.Length)
{
char[] tmp = new char[stringBuffer.Length * 2];
System.Array.Copy(stringBuffer, 0, tmp, 0, N);
stringBuffer = tmp;
}
stringBuffer[N] = (char)c;
stringBufferTop = N + 1;
}