コード例 #1
0
        /// <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));
        }
コード例 #2
0
        /// <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));
        }
コード例 #3
0
        /// <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));
        }
コード例 #4
0
        /// <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));
        }