Пример #1
0
        public void CSnappySnappyInteractionTest()
        {
            int loop = 50;

            for (int i = 0; i < loop; i++)
            {
                var data    = _dataCreator.GenerateTestData(50 * i + 500);
                var csnappy = new SnappyDOTNETCompressor();
                var snappy  = new SnappyCompressor();


                var ms = new MemoryStream();

                ms.Write(data, 0, data.Length);

                var compressedData  = csnappy.Compress(ms.ToArray());
                var compressedData1 = snappy.Compress(data);

                Assert.IsTrue(compressedData1.SequenceEqual(compressedData));

                var decompressedData = snappy.Decompress(compressedData);

                Assert.IsTrue(data.SequenceEqual(decompressedData));

                compressedData = snappy.Compress(data);

                decompressedData = csnappy.Decompress(compressedData);

                Assert.IsTrue(data.SequenceEqual(decompressedData));
            }
        }
Пример #2
0
        public void CSnappySnappyInteractionTest()
        {
            int loop = 50;
            for (int i = 0; i < loop; i++)
            {

                var data = _dataCreator.GenerateTestData(50 * i + 500);
                var csnappy = new SnappyDOTNETCompressor();
                var snappy = new SnappyCompressor();

                var ms = new MemoryStream();

                ms.Write(data, 0, data.Length);

                var compressedData = csnappy.Compress(ms.ToArray());
                var compressedData1 = snappy.Compress(data);

                Assert.IsTrue(compressedData1.SequenceEqual(compressedData));

                var decompressedData = snappy.Decompress(compressedData);

                Assert.IsTrue(data.SequenceEqual(decompressedData));

                compressedData = snappy.Compress(data);

                decompressedData = csnappy.Decompress(compressedData);

                Assert.IsTrue(data.SequenceEqual(decompressedData));
            }
        }
Пример #3
0
 static CompressorFactory()
 {
     compressorCache["snappy"] = new SnappyDOTNETCompressor();
     compressorCache["gzip"] = new GzipCompressor();
     compressorCache["deflate"] = new DeflateCompressor();
 }
Пример #4
0
 static CompressorFactory()
 {
     compressorCache["snappy"]  = new SnappyDOTNETCompressor();
     compressorCache["gzip"]    = new GzipCompressor();
     compressorCache["deflate"] = new DeflateCompressor();
 }
Пример #5
0
        public void CSnappyCompressorTest()
        {
            var compressor = new SnappyDOTNETCompressor();

            TestCompressor(compressor);
        }
Пример #6
0
 public void CSnappyCompressorTest()
 {
     var compressor = new SnappyDOTNETCompressor();
     TestCompressor(compressor);
 }