/// <summary> /// Reads a binary WebAssembly from the given stream. /// </summary> /// <param name="source">The stream from which a WebAssembly file is to be read.</param> /// <param name="streamIsEmpty">Tests if the input stream is empty.</param> /// <returns>The WebAssembly file.</returns> public static WasmFile ReadBinary(Stream source, Func <bool> streamIsEmpty) { // Create a WebAssembly reader and read the file. var reader = new BinaryReader(source); var wasmReader = new BinaryWasmReader(reader, streamIsEmpty); return(wasmReader.ReadFile()); }
/// <summary> /// Reads a binary WebAssembly from the given stream. /// </summary> /// <param name="Source">The stream from which a WebAssembly file is to be read.</param> /// <returns>The WebAssembly file.</returns> public static WasmFile ReadBinary(Stream Source) { // Create a WebAssembly reader and read the file. var reader = new BinaryReader(Source); var wasmReader = new BinaryWasmReader(reader); return(wasmReader.ReadFile()); }