Copy bytes from an Integer to a location of bytes array 
Author Message
 Copy bytes from an Integer to a location of bytes array

I know in C programming, it is fairly easy to use "memcpy"
to copy the 4 bytes of an Integer data to any location of
a byte array. Is there similiar easy way in VB.NET?

Thanks,

Alan Guo



Sun, 18 Sep 2005 23:29:58 GMT  
 Copy bytes from an Integer to a location of bytes array
Alan,

Quote:
>I know in C programming, it is fairly easy to use "memcpy"
>to copy the 4 bytes of an Integer data to any location of
>a byte array. Is there similiar easy way in VB.NET?

System.BitConverter.GetBytes combined with Buffer.BlockCopy or
Array.Copy[To]

Mattias

===

http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.



Mon, 19 Sep 2005 00:17:29 GMT  
 Copy bytes from an Integer to a location of bytes array
Thanks.

Alan

Quote:
>-----Original Message-----
>Alan,

>>I know in C programming, it is fairly easy to
use "memcpy"
>>to copy the 4 bytes of an Integer data to any location
of
>>a byte array. Is there similiar easy way in VB.NET?

>System.BitConverter.GetBytes combined with
Buffer.BlockCopy or
>Array.Copy[To]

>Mattias

>===

>http://www.msjogren.net/dotnet/
>Please reply only to the newsgroup.
>.



Mon, 19 Sep 2005 00:34:16 GMT  
 Copy bytes from an Integer to a location of bytes array

Quote:
> I know in C programming, it is fairly easy to use "memcpy"
> to copy the 4 bytes of an Integer data to any location of
> a byte array. Is there similiar easy way in VB.NET?

System.BitConverter.GetBytes

--
Armin



Sun, 18 Sep 2005 23:57:07 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Need to convert a 16 byte array of bytes to 4 byte integer

2. Converting integers and long integers to byte arrays

3. copying a file byte per byte

4. Copying a long array into a byte array and back

5. Copying a long array into a byte array and back

6. Copying a long array into a byte array and back

7. Copying a long array into a byte array and back

8. Copying a long array into a byte array and back

9. VB6 Byte Array to Byte()

10. Byte array from an integer?

11. Convert integers and strings to byte array

12. Convert byte-array to integer or real?

 

 
Powered by phpBB® Forum Software