converting byte array to int32

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

how do i convert array of 4 byte to integer. I have a byte(4) byte(0)=0,
byte(1)=0 byte(2)=0 and byte(4)=37. This is equal to 37 int32 number. How do
i convert it to the integer.
 
bestin said:
how do i convert array of 4 byte to integer. I have a byte(4) byte(0)=0,
byte(1)=0 byte(2)=0 and byte(4)=37. This is equal to 37 int32 number. How do
i convert it to the integer.

That looks like it's big endian rather than little endian, so
BitConverter won't do the trick. However, I have an
"EndianBitConverter" which allows you to specify the endianness.

You can get it at http://www.pobox.com/~skeet/csharp/miscutil
 
Back
Top