Exemplo n.º 1
0
        public void TestLowLevelRoundTrip()
        {
            foreach (var file in Directory.GetFiles(_filesDirectory, "*.wasm"))
            {
                TestContext.WriteLine("Testing {0}", file);
                var tmpFile = Path.GetTempFileName();

                ModuleMetadata moduleMetadata;
                using (var stream = new FileStream(file, FileMode.Open, FileAccess.Read))
                    using (var reader = new BinaryReader(stream))
                        moduleMetadata = ModuleMetadata.Read(reader);

                using (var stream = new FileStream(tmpFile, FileMode.Create, FileAccess.Write))
                    using (var writer = new BinaryWriter(stream))
                        moduleMetadata.Write(writer);

                FileHelper.CompareFiles(file, tmpFile);
            }
        }
Exemplo n.º 2
0
        public static Module Read(BinaryReader reader)
        {
            var moduleMetadata = ModuleMetadata.Read(reader);

            return(moduleMetadata.Module);
        }