convert bytes to long value

P

Paul

I need to convert 4 bytes into a long. In C I would do long l = *(long
*)&buffer[10]; buffer is an array of bytes read from a file. What's the
C# syntax?
 
K

Kevin Spencer

Use the System.BitConverter class to convert the array of bytes to an Int64
value.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 

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

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top