Need some help in converting a byte[] to a signed int. This is what I
have attempted to do:
byte[] bytes = new byte[3] { 0xFF, 0xFF, 0x9C};
StringBuilder hexString = new StringBuilder() ;
foreach (byte tmpByte in bytes) hexString.Appen d(tmpByte.ToStr ing("X2"));
int intValue = int.Parse(hexSt ring.ToString() ,
NumberStyles.Al lowHexSpecific) ;
I am getting a positive intValue. However, the intValue is supposed to
be a negative value. Any help would be greatly appreciated.
JT
have attempted to do:
byte[] bytes = new byte[3] { 0xFF, 0xFF, 0x9C};
StringBuilder hexString = new StringBuilder() ;
foreach (byte tmpByte in bytes) hexString.Appen d(tmpByte.ToStr ing("X2"));
int intValue = int.Parse(hexSt ring.ToString() ,
NumberStyles.Al lowHexSpecific) ;
I am getting a positive intValue. However, the intValue is supposed to
be a negative value. Any help would be greatly appreciated.
JT
Comment