コード例 #1
0
ファイル: v82oEXP.cs プロジェクト: q4a/ToxicRagers
        public void Extract(EXPEntry file, string destination)
        {
            if (!Directory.Exists(destination))
            {
                Directory.CreateDirectory(destination);
            }

            using (BinaryWriter bw = new BinaryWriter(new FileStream(destination + "\\" + file.Filename, FileMode.Create)))
                using (FileStream fs = new FileStream(location + name + ".exp", FileMode.Open))
                {
                    fs.Seek(file.Offset, SeekOrigin.Begin);

                    byte[] buff = new byte[file.Size];
                    fs.Read(buff, 0, file.Size);
                    bw.Write(buff);
                    buff = null;
                }
        }
コード例 #2
0
ファイル: v82oEXP.cs プロジェクト: DevilboxGames/ToxicRagers
        public void Extract(EXPEntry file, string destination)
        {
            if (!Directory.Exists(destination)) { Directory.CreateDirectory(destination); }

            using (var bw = new BinaryWriter(new FileStream(destination + "\\" + file.Filename, FileMode.Create)))
            {
                using (var fs = new FileStream(this.location + this.name + ".exp", FileMode.Open))
                {
                    fs.Seek(file.Offset, SeekOrigin.Begin);

                    var buff = new byte[file.Size];
                    fs.Read(buff, 0, file.Size);
                    bw.Write(buff);
                    buff = null;
                }
            }
        }