CSharp examples for System:Byte Array
Convert byte array To UInt32
using System.Text; using System;/*from w w w .ja v a2s . co m*/ public class Main{ public static UInt32[] ToUInt32(byte[] source, int sourceOffset, int size) { var arr = new UInt32[size]; for (int i = 0; i < size; i++) arr[i] = bitConverter.ToUInt16(source, sourceOffset + (i * sizeof(UInt32))); return arr; } public static UInt16[] ToUInt16(byte[] source, int sourceOffset, int size) { var arr = new UInt16[size]; for (int i = 0; i < size; i++) arr[i] = bitConverter.ToUInt16(source, sourceOffset + (i * sizeof (UInt16))); return arr; } }