コード例 #1
0
        // Token: 0x06000085 RID: 133 RVA: 0x0000CA70 File Offset: 0x0000AC70
        private static Stream LoadStream(string fullName)
        {
            Assembly executingAssembly = Assembly.GetExecutingAssembly();

            if (fullName.EndsWith(".compressed"))
            {
                using (Stream manifestResourceStream = executingAssembly.GetManifestResourceStream(fullName))
                {
                    using (DeflateStream deflateStream = new DeflateStream(manifestResourceStream, CompressionMode.Decompress))
                    {
                        MemoryStream memoryStream = new MemoryStream();
                        AssemblyLoader.CopyTo(deflateStream, memoryStream);
                        memoryStream.Position = 0L;
                        return(memoryStream);
                    }
                }
            }
            return(executingAssembly.GetManifestResourceStream(fullName));
        }
コード例 #2
0
ファイル: AssemblyLoader.cs プロジェクト: emudevs/BDDatabase
        private static Stream LoadStream(string fullName)
        {
            Assembly executingAssembly = Assembly.GetExecutingAssembly();

            if (!fullName.EndsWith(".compressed"))
            {
                return(executingAssembly.GetManifestResourceStream(fullName));
            }
            using (Stream manifestResourceStream = executingAssembly.GetManifestResourceStream(fullName))
            {
                using (DeflateStream deflateStream = new DeflateStream(manifestResourceStream, CompressionMode.Decompress))
                {
                    MemoryStream memoryStream = new MemoryStream();
                    // ISSUE: reference to a compiler-generated method
                    AssemblyLoader.CopyTo((Stream)deflateStream, (Stream)memoryStream);
                    memoryStream.Position = 0L;
                    return((Stream)memoryStream);
                }
            }
        }