public Savegame(string filename, OffsetsClass of) { _offsets = of; using (FileStream io = new FileStream(filename, FileMode.Open, FileAccess.Read)) { BinaryReader bRead = new BinaryReader(io); savedata = new byte[io.Length]; bRead.Read(savedata, 0, savedata.Length); bRead.Close(); io.Close(); break_down(savedata); } }
public bool load_file(string filename) { _form.barStatus.Caption = "Status: Reading..."; _form.pBar.Properties.Maximum = 5; // setup file and tempfile tmpfile = Path.GetTempFileName(); file = filename; _form.progressbar_inc(); FileStream fsOut = new FileStream(tmpfile, FileMode.Create, FileAccess.Write); // get & witeout clean file data xpack = new STFS(filename); byte[] cleanbuffer = xpack.extractFile(); _form.progressbar_inc(); fsOut.Write(cleanbuffer, 0, cleanbuffer.Length); fsOut.Close(); _form.progressbar_inc(); offsets = new OffsetsClass(tmpfile); _form.progressbar_inc(); savegame = new Savegame(tmpfile, offsets); _form.progressbar_inc(); _form.barStatus.Caption = "Status: Done"; return true; }
public Savegame(byte[] sdata, OffsetsClass of) { _offsets = of; savedata = sdata; break_down(sdata); }