private void button1_Click(object sender, EventArgs e) { if (File.Exists(textBox1.Text)) { using (var compressedInputStream = File.OpenRead(textBox1.Text)) { var saveFile = new CyberPunkSaveFile(); saveFile.ReadHeader(compressedInputStream); saveFile.Decompress(compressedInputStream); saveFile.Compress("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) { if (saveFile == null) { MessageBox.Show( "Decompress first!", "Error in Compressing", MessageBoxButtons.OK, MessageBoxIcon.Asterisk ); } else { saveFile.Compress("output_2.bin"); } }
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); // } //} } }