Exemplo n.º 1
0
 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");
     }
 }
Exemplo n.º 2
0
 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");
     }
 }
Exemplo n.º 3
0
 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);
         //    }
         //}
     }
 }