Hi All,
What is wrong with the following? C# claims:
"An unhandled exception of type 'System.OverflowException' occurred in
mscorlib.dll Additional information: Value was either too large or too
small for an unsigned byte."
The offending code is:
// vector< byte >
ArrayList Octets = new ArrayList();
....
Int32 i=0;
while( i < Octets.Count )
{
Byte b = Byte.Parse(Octets[i].ToString());
b &= unchecked(Convert.ToByte(~0x80)); // Problem Here
if( 0x00 == b ) { break; }
....
i++;
}
Frow what I understand, 0x80 is an Int32. operator~ gives me a 32 bit
compliment. unchcked turns off overflow checking, so the cast to a
Byte should work (without overflow complaints)...
Jeff
Jeffrey Walton