/// <summary> /// Reads a unique identifier from <paramref name="source"/> and then 'advances'. /// </summary> /// <exception cref="IndexOutOfRangeException">Thrown if the <paramref name="source"/> does not have enough data to read a value of type <typeparamref name="T"/>.</exception> public static long ReadUniqueId <T>(this IHFormat format, ref ReadOnlySpan <byte> source) where T : struct { long uniqueId = format.ReadUniqueId(source, out int bytesRead); source = source.Slice(bytesRead); return(uniqueId); }