/// <summary> /// Returns the ROM header using the data from the provided stream. /// </summary> /// <param name="romStream">The ROM data stream.</param> /// <param name="cancellationToken">The cancellation token.</param> public static ValueTask <RomHeader> GetHeaderAsync(Stream romStream, CancellationToken cancellationToken = default) { Guard.IsNotNull(romStream, nameof(romStream)); return(RomStream.GetHeaderFromStreamAsync(romStream, cancellationToken)); }
/// <summary> /// Loads a ROM using the data from the provided stream. /// </summary> /// <param name="romStream">The ROM data stream.</param> /// <param name="disposeStream">Whether to dispose of the stream when the ROM data is disposed.</param> /// <param name="cancellationToken">The cancellation token.</param> public static ValueTask <IRomData> LoadRomAsync(Stream romStream, bool disposeStream = false, CancellationToken cancellationToken = default) { Guard.IsNotNull(romStream, nameof(romStream)); return(RomStream.CreateAsync(romStream, disposeStream, cancellationToken)); }
/// <summary> /// Returns the ROM header using the data from the provided stream. /// </summary> /// <param name="romStream">The ROM data stream.</param> public static RomHeader GetHeader(Stream romStream) { Guard.IsNotNull(romStream, nameof(romStream)); return(RomStream.GetHeaderFromStream(romStream)); }
/// <summary> /// Loads a ROM using the data from the provided stream. /// </summary> /// <param name="romStream">The ROM data stream.</param> /// <param name="disposeStream">Whether to dispose of the stream when the ROM data is disposed.</param> public static IRomData LoadRom(Stream romStream, bool disposeStream = false) { Guard.IsNotNull(romStream, nameof(romStream)); return(RomStream.Create(romStream, disposeStream)); }