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; } }
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; } } }