Exemplo n.º 1
0
        public void TestCompress()
        {
            var checkValue     = generateData(checkCount);
            var compressSize   = CompressUtil.CompressSize(checkValue);
            var compressbuffer = BufferManager.Take(compressSize);

            var ret = CompressUtil.Compress(checkValue, compressbuffer, checkCount);

            var decompressSize = CompressUtil.DecompressSize(compressbuffer);

            Assert.AreEqual(decompressSize, checkCount);

            byte[] decompressBuffer = new byte[decompressSize];

            ret = CompressUtil.Decompress(compressbuffer, decompressBuffer);
            Assert.AreEqual(ret, checkCount);

            checkData(checkValue, decompressBuffer);
        }