Beispiel #1
0
        public static void Main(string[] args)
        {
            string str = "i like like like java do you like a java";

            // string str = "aaa";
            //重要的源数据
            Console.WriteLine("原始长度:" + str.Length);
            CreatedHuffmanData huffmanCode = new CreatedHuffmanData();

            huffmanCode.CreHuffmanData(str);
            for (int i = 0; i < huffmanCode.HuffmanData.Length; i++)
            {
                Console.WriteLine(huffmanCode.HuffmanData[i]);
            }

            Console.WriteLine("解压");
            Unzip unzip = new Unzip();
            var   zip   = unzip.Bytes(huffmanCode.GetHuffmanCodeMap(), huffmanCode.HuffmanData);

            Console.WriteLine(zip);
        }