convert Int32 to array of bytes (2)

  • Thread starter Thread starter Jan
  • Start date Start date
J

Jan

How can I convert Int32 (4 bytes long) value to array of
bytes?
I need only 4 bytes in result.

example: long value 55695542 -->

arr(0) == &HB6
arr(1) == &HD8
arr(2) == &H51
arr(3) == &H03


Thank you
 
Jan said:
How can I convert Int32 (4 bytes long) value to array of
bytes?
I need only 4 bytes in result.

example: long value 55695542 -->

arr(0) == &HB6
arr(1) == &HD8
arr(2) == &H51
arr(3) == &H03

Dim arr as byte()
arr = BitConverter.GetBytes(MyInt)
 
Back
Top