byte [] ToByteArray(int a, int b)
{
return ???;
}
void FromByteArray(byte [] byteArray, out int a, out int b)
{
???
}
Thanks,
Andrew
Unfortunately the normal BitConverter doesn't help you as much as it
could in terms of putting them together.
I have a version of BitConverter in my miscellaneous utility library
which not only allows you to specify the endianness, but also has a
CopyBytes method (IIRC - something like that). It's like GetBytes, but
it lets you specify an existing byte array and the index at which to
copy the bytes.
FromByteArray is reasonable with the normal BitConverter though - just
use:
a = BitConverter.ToInt32(byteArray, 0);
b = BitConverter.ToInt32(byteArray, 4);
My library is available at
http://www.pobox.com/~skeet/csharp/miscutil
Jon
Andrew
Regards,
Frank Hileman
check out VG.net: http://www.vgdotnet.com
Animated vector graphics system
Integrated Visual Studio graphics editor
"amaca" <pub...@ajam.net> wrote in message
news:e%23fw9XiN...@TK2MSFTNGP09.phx.gbl...
Andrew