public static long parselong( byte[] buf, int pos, int bout, int radix )
{
long result = 0;
bool neg = false;
byte cn;
if (buf[pos] == (byte) '-')
{
++pos;
neg= true;
}
if (buf[pos] == (byte) '+')
{
++pos;
neg= false;
}
while (pos < bout)
{
cn= buf[pos++];
if (((byte)'0' <= cn) && (cn <= (byte)'9'))
result= result * radix + (cn - (byte) '0');
else if (cn <= (byte)'Z')
result= result * radix + 10 + (cn - (byte) 'A');
else
result= result * radix + 10 + (cn - (byte) 'a');
}
return (neg ? -result : result);
}