convert Int32 to array of bytes (2)

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
 
A

Armin Zingler

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top