in csharp/src/Containers/BinaryAsciiString.cs [796:834]
private BinaryAsciiString AppendInteger(Int64 i)
{
hashCode = hashCode | 0x40000000;
byte t;
Expand(((lastByte + 21) >> 3) + 1);
unsafe
{
fixed (long* ptr = data)
{
byte* bytePtr = (byte*)(ptr) + lastByte;
if (i < 0)
{
*(bytePtr) = (byte)('-');
bytePtr++;
i = -i;
lastByte++;
}
int oldLen = lastByte;
Int32 index = 0, index2;
lastByte += 21;
do
{
*(bytePtr + index) = (byte)((i % 10) + '0');
index++;
i /= 10;
} while (i != 0);
index--;
index2 = index / 2;
for (Int32 j = 0, l = index; j <= index2; ++j, --l)
{
t = *(bytePtr + l);
*(bytePtr + l) = *(bytePtr + j);
*(bytePtr + j) = t;
}
lastByte = oldLen + index + 1;
}
}
return this;
}