Question: [This](https://stackoverflow.com/questions/7288897/how-do-i-convert-byte-array-to-uint32-array) question only vise versa. For now I got this:

```
UInt32[] target;

byte[] decoded = new byte[target.Length * 2];
Buffer.BlockCopy(target, 0, decoded, 0, target.Length);

```

And this doesn't work, I get array filled with `0x00`.

Answer: 
I would recommend something like the following:

```
UInt32[] target;

//Assignments

byte[] decoded = new byte[target.Length * sizeof(uint)];
Buffer.BlockCopy(target, 0, decoded, 0, decoded.Length);

```

See code:

```
uint[] target = new uint[] { 1, 2, 3 };

//Assignments

byte[] decoded = new byte[target.Length * sizeof(uint)];
Buffer.BlockCopy(target, 0, decoded, 0, decoded.Length);

for (int i = 0; i < decoded.Length; i++)
{
    Console.WriteLine(decoded[i]);
}

Console.ReadKey();

```

Also see:

* [Size of values](http://msdn.microsoft.com/en-us/library/eahchzkf.aspx)
* [Int Array to Byte Array](https://stackoverflow.com/questions/5896680/int-array-to-byte-array)
* [BlockCopy MSDN](http://msdn.microsoft.com/en-us/library/system.buffer.blockcopy.aspx)
You need to multiple by `4` to create your `byte` array, since `UInt32` is 4 bytes (32 bit). But use `BitConverter` and fill a list of `byte` and late you can create an array out of it if you need. 

```
UInt32[] target = new UInt32[] { 1, 2, 3 };
byte[] decoded = new byte[target.Length * 4]; //not required now
List<byte> listOfBytes = new List<byte>();
foreach (var item in target)
{
    listOfBytes.AddRange(BitConverter.GetBytes(item));   
}

```

If you need array then:

```
byte[] decoded = listOfBytes.ToArray();

```