Пример #1
0
        public void Descomprimir()
        {
            string descomprimido = "";

            const int  bufferLength   = 100;
            List <int> bytedecompress = new List <int>();

            var buffer = new char[bufferLength];

            using (var file = new FileStream(path, FileMode.Open))
            {
                using (var reader = new BinaryReader(file))
                {
                    while (reader.BaseStream.Position != reader.BaseStream.Length)
                    {
                        buffer = reader.ReadChars(bufferLength);
                        foreach (var item in buffer)
                        {
                            bytedecompress.Add((int)Convert.ToChar(item));
                        }
                    }
                }
            }

            descomprimido = LZW.Descompresion(bytedecompress);
            root          = root + @"\\Upload\\decomprimidoLZW.txt";
            File.WriteAllText(@root, descomprimido);
            int a = 0;
        }