Aug 26, 2008

Convert Array of Ints into bytes

Here is the code to convert array of Ints to bytes:

int[] source = ids.ToArray();
int length = source.Length * 4;
byte[] dest = new byte[length];
System.Buffer.BlockCopy(source, 0, dest, 0, dest.Length);

kick it on DotNetKicks.com

No comments: