Пример #1
0
        public void Test005()
        {
            var co     = new CompressionHuffmanCodingASCII();
            var intext = "Much of the South's infrastructure was destroyed, especially its railroads. The Confederacy collapsed, slavery was abolished, and four million black slaves were freed. The war is one of the most studied and written about episodes in U.S. history.";
            var bufin  = Encoding.UTF8.GetBytes(intext);
            var bufout = co.Compress(bufin);

            var bufin2  = co.Decompress(bufout);
            var outtext = Encoding.UTF8.GetString(bufin2);

            Assert.AreEqual(intext, outtext);
        }
Пример #2
0
        public void Test006()
        {
            var co     = new CompressionHuffmanCodingASCII();
            var intext = "東京都特許許可局、蛙ピョコピョコ3ピョコピョコ、合わせてピョコピョコ、6ピョコピョコ。";
            var bufin  = Encoding.UTF8.GetBytes(intext);
            var bufout = co.Compress(bufin);

            var bufin2  = co.Decompress(bufout);
            var outtext = Encoding.UTF8.GetString(bufin2);

            Assert.AreEqual(intext, outtext);
        }
Пример #3
0
        public void Test004()
        {
            var co     = new CompressionHuffmanCodingASCII();
            var intext = "Hello C# World!!";
            var bufin  = Encoding.UTF8.GetBytes(intext);
            var bufout = co.Compress(bufin);

            var bufin2  = co.Decompress(bufout);
            var outtext = Encoding.UTF8.GetString(bufin2);

            Assert.AreEqual(intext, outtext);
        }