private void button1_Click(object sender, EventArgs e) { var file = textBox1.Text + "/sav.dat"; if (File.Exists(file)) { using (var compressedInputStream = File.OpenRead(file)) { saveFile = new CyberPunkSaveFile(); saveFile.ReadHeader(compressedInputStream); saveFile.Decompress(compressedInputStream); //saveFile.Compress("/Output/output.bin"); //_chunkedFile = new ChunkedLz4File(compressedInputStream); //using (var inputStream = _chunkedFile.Decompress(compressedInputStream)) //{ // using (var fileStream = File.Create(@"H:\CP2077_sg\output.bin")) // { // inputStream.Seek(0, SeekOrigin.Begin); // inputStream.CopyTo(fileStream); // } //} } } else { MessageBox.Show("File does not exist"); } }
private void button2_Click(object sender, EventArgs e) { using (var compressedInputStream = File.OpenRead(@"output.bin")) { var saveFile = new CyberPunkSaveFile(); saveFile.ReadHeader(compressedInputStream); saveFile.Decompress(compressedInputStream); saveFile.Compress("output_2.bin"); //_chunkedFile = new ChunkedLz4File(compressedInputStream); //using (var inputStream = _chunkedFile.Decompress(compressedInputStream)) //{ // using (var fileStream = File.Create(@"H:\CP2077_sg\output.bin")) // { // inputStream.Seek(0, SeekOrigin.Begin); // inputStream.CopyTo(fileStream); // } //} } }