Friday, January 20, 2012

Converting integer to byte[]

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

 

Example:

C#

int a= 102;
byte[] b = BitConverter.GetBytes(a);

No comments:

Post a Comment