Friday, January 20, 2012

Converting byte[] to integer

You can convert an integer value to byte array using BitConverter.ToInt32 method

Example:

C#

byte[] b = { 102, 0, 0, 0 };
int a = BitConverter.ToInt32(b, 0);

No comments:

Post a Comment