예제 #1
0
        private void replaceToolStripMenuItem_Click(object sender, EventArgs e)
        {
            byte[] compressedSarc = null;
            var    s = SARC.packAlign(loadedSarc);

            if (numericUpDown1.Value != 0)
            {
                compressedSarc = YAZ0.Compress(s.Item2, (int)numericUpDown1.Value, s.Item1);
            }
            else
            {
                compressedSarc = s.Item2;
            }
            //sourceStream.Position = 0;
            sourceStream.Write(compressedSarc, 0, compressedSarc.Length);
        }
예제 #2
0
        private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var sav = new SaveFileDialog()
            {
                Filter = "szs file|*.szs"
            };

            if (sav.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            if (numericUpDown1.Value == 0)
            {
                File.WriteAllBytes(sav.FileName, SARC.pack(loadedSarc));
            }
            else
            {
                var s = SARC.packAlign(loadedSarc);
                File.WriteAllBytes(sav.FileName, YAZ0.Compress(s.Item2, (int)numericUpDown1.Value, s.Item1));
            }
        }