unsafe string ReadAtomString (byte* inbuf, bool flag, string specials, CancellationToken cancellationToken)
{
var builder = new StringBuilder ();
byte* inptr = inbuf + inputIndex;
byte* inend = inbuf + inputEnd;
do {
*inend = (byte) '\n';
if (flag && builder.Length == 0 && *inptr == (byte) '*') {
// this is a special wildcard flag
inputIndex++;
return "*";
}
while (IsAtom (*inptr, specials))
builder.Append ((char) *inptr++);
if (inptr < inend)
break;
inputIndex = (int) (inptr - inbuf);
ReadAhead (1, cancellationToken);
inptr = inbuf + inputIndex;
inend = inbuf + inputEnd;
} while (true);
inputIndex = (int) (inptr - inbuf);
return builder.ToString ();
}