Getting four bytes from a byte array in VB.NET
I have a byte array, and I need to get four bytes from it at a certain location (16), but I don't want to convert it to an integer开发者_开发问答 or anything. Just keep it as four bytes to store in a variable.
If you have say:
byte[] source; // source array
byte[] dest=new byte[4];
Then you'd copy 4 bytes from source
starting at 16 to dest
like this:
Array.Copy(source, 16, dest, 0, 4);
精彩评论