I've been trying to figure out how mscorlib Convert.ToInt32(byte)
works given I only have access to .Net 2.0 for a project. Trying to use a .Net reflector to open that dll has resulted in no help so far in trying to see how .Net handled it in .Net 4.5 (which again, I don't have access to for this project).
Could someone explain how Convert.ToInt32(byte) works to convert and create a 32 bit signed int from a byte and how in code I can do this?
I've noticed there is a huge difference in the code below. Is it just a lower and upper bounds set for int32 and returns 0 if outside?
Console.WriteLine(
Convert.ToInt32(buffer[i]).ToString() +
" " +
BitConverter.ToInt32(buffer, i).ToString()
);