Exemplo n.º 1
0
        public static void agregarNuevaCompresion(MisCompresiones nuevo)
        {
            string path = nuevo.RutaO;

            using (StreamWriter sw = File.AppendText(path))
            {
                string text =
                    $" {nuevo.nombreOriginal},  {nuevo.razonDeCompresion},   {nuevo.factorDeCompresion},  {nuevo.porcentajeDeCompresion},{nuevo.RutaO}";
                if (!text.Equals(""))
                {
                    sw.WriteLine(text);
                }
            }
        }
Exemplo n.º 2
0
        public void Comprimir(string RPath, string WPath, string originalName, string WPath2)
        {
            FrequencyTable = new Dictionary <byte, int>();
            CharacterTable = new Dictionary <byte, string>();
            HuffmanTree(RPath);
            GetPrefixCodes();
            ValueFrequencyWrite(WPath, originalName);
            Recorre(RPath, WPath);
            #region FileInfo

            FileInfo originalFile   = new FileInfo(RPath);
            FileInfo compressedFile = new FileInfo(WPath);
            MisCompresiones.agregarNuevaCompresion(new MisCompresiones(Path.GetFileName(RPath), originalFile.Length, compressedFile.Length, WPath2)); //Anadir a mis compresiones

            #endregion
        }