Microsoft.Protocols.TestTools.StackSdk.BranchCache.Pchc.DecodeMessage.GetUInt32 C# (CSharp) Method

GetUInt32() private static method

Parse uint from bytes
private static GetUInt32 ( byte buffer, int &index, bool isBigEndian ) : uint
buffer byte The buffer stores the value.
index int The index of start to parse
isBigEndian bool Order of bytes. If it's big endian, set it to true, else set it to false.
return uint
        private static uint GetUInt32(byte[] buffer, ref int index, bool isBigEndian)
        {
            uint uintReturn = 0;
            byte[] byteTemp = BitConverter.GetBytes(uintReturn);

            Array.Copy(buffer, index, byteTemp, 0, byteTemp.Length);
            ReverseByFlag(isBigEndian, byteTemp);
            uintReturn = BitConverter.ToUInt32(byteTemp, 0);
            index += byteTemp.Length;

            return uintReturn;
        }