static public int ToCharsR(long value, byte[] chars, int offset)
{
int count = 0;
if (value >= 0)
{
while (value > int.MaxValue)
{
long valueDiv10 = value / 10;
count++;
chars[--offset] = (byte)('0' + (int)(value - valueDiv10 * 10));
value = valueDiv10;
}
}
else
{
while (value < int.MinValue)
{
long valueDiv10 = value / 10;
count++;
chars[--offset] = (byte)('0' - (int)(value - valueDiv10 * 10));
value = valueDiv10;
}
}
Fx.Assert(value >= int.MinValue && value <= int.MaxValue, "");
return count + ToCharsR((int)value, chars, offset);
}