Microsoft.Protocols.TestSuites.SharedAdapter.LittleEndianBitConverter.ToUInt64 C# (CSharp) Method

ToUInt64() public static method

Returns a 64-bit unsigned integer converted from two bytes at a specified position in a byte array.
public static ToUInt64 ( byte array, int index ) : ulong
array byte Specify an array of bytes.
index int Specify the starting position.
return ulong
        public static ulong ToUInt64(byte[] array, int index)
        {
            CheckByteArgument(array, index, 8);
            return unchecked((ulong)ConvertFromBytes(array, index, 8));
        }

Usage Example

Example #1
0
        /// <summary>
        /// Used to de-serialize the element.
        /// </summary>
        /// <param name="byteArray">A Byte array</param>
        /// <param name="currentIndex">Start position</param>
        /// <param name="lengthOfItems">The length of the items</param>
        protected override void DeserializeItemsFromByteArray(byte[] byteArray, ref int currentIndex, int lengthOfItems)
        {
            if (lengthOfItems != 8)
            {
                throw new StreamObjectParseErrorException(currentIndex, "DataSize", "Stream Object over-parse error", null);
            }

            this.DataSize = LittleEndianBitConverter.ToUInt64(byteArray, currentIndex);
            currentIndex += 8;
        }
All Usage Examples Of Microsoft.Protocols.TestSuites.SharedAdapter.LittleEndianBitConverter::ToUInt64