Home All Groups Group Topic Archive Search About

How to convert integer(long) to byte array?

Author
13 Apr 2005 3:11 PM
Alexander Levchenko
Hi All!

In VB6 it was relatively simple with API-function "CopyMemory".
Anybody know another possibility to make it?

Thanks,
Alexander

Author
13 Apr 2005 3:38 PM
Larry Lard
Alexander Levchenko wrote:
> Hi All!
>
> In VB6 it was relatively simple with API-function "CopyMemory".
> Anybody know another possibility to make it?

It's even simpler now, and type-safe to boot! BitConverter.GetBytes
takes anything and returns a Byte().

--
Larry Lard
Replies to group please
Author
7 Jul 2005 5:07 AM
yishmael
Simpler it is not. Type-safe it is not. (Anything that returns a Byte
regardless of the source is not Type anything). At least it works. A few more
simplifications like this, and even less people will see programming as fun.
--
Signatore


Show quoteHide quote
"Larry Lard" wrote:

>
> Alexander Levchenko wrote:
> > Hi All!
> >
> > In VB6 it was relatively simple with API-function "CopyMemory".
> > Anybody know another possibility to make it?
>
> It's even simpler now, and type-safe to boot! BitConverter.GetBytes
> takes anything and returns a Byte().
>
> --
> Larry Lard
> Replies to group please
>
>