/// <summary> /// Parses the byte-array to UInt32. /// </summary> /// <returns>The user interface nt32.</returns> /// <param name="bytes">Bytes.</param> /// <param name="offset">Offset.</param> public static uint ParseUInt32(byte[] bytes, ref int offset) { var readBytes = 0; var newBytes = new byte[bytes.Length - offset]; Array.Copy(bytes, offset, newBytes, 0, bytes.Length - offset); var uintResult = VarintBitConverter.ToUInt32(newBytes, out readBytes); offset += readBytes; return(uintResult); }
/// <summary> /// Parses the byte-array to Int32. /// </summary> /// <returns>The user interface nt32.</returns> /// <param name="bytes">Bytes.</param> public static uint ParseUInt32(byte[] bytes) { return(VarintBitConverter.ToUInt32(bytes)); }
/// <summary> /// Parses the stream to UInt32. /// </summary> /// <returns>The user interface nt32.</returns> /// <param name="stream">Stream.</param> public static uint ParseUInt32(Stream stream) { var byteArray = ParseStreamToByteArray(stream); return(VarintBitConverter.ToUInt32(byteArray)); }