/// <summary> /// Writes <paramref name="uniqueId"/> into <paramref name="destination"/>. /// </summary> /// <exception cref="IndexOutOfRangeException">Thrown if the <paramref name="uniqueId"/> does not fit into the <paramref name="destination"/>.</exception> public static void WriteUniqueId(this IHFormat format, Span <byte> destination, long uniqueId, out int bytesWritten) { if (!format.TryWriteUniqueId(destination, uniqueId, out bytesWritten)) { ThrowHelper.ThrowIndexOutOfRangeException(); } }