Ejemplo n.º 1
0
 static void Main(string[] args)
 {
     using (var fs = File.OpenRead("psb.lz4"))
     {
         var decoded  = LZ4Frame.Decompress(fs);
         var encoded  = LZ4Frame.Compress(new MemoryStream(decoded), useContentSize: false);
         var decoded2 = LZ4Frame.Decompress(new MemoryStream(encoded));
         var r        = decoded2.SequenceEqual(decoded);
         Console.WriteLine($"{r} {fs.Position}");
         Console.ReadLine();
     }
 }
Ejemplo n.º 2
0
        public void TestCompress()
        {
            var resPath = Path.Combine(Environment.CurrentDirectory, @"..\..\Res");
            var path    = Path.Combine(resPath, "psb3.lz4");

            using (var fs = File.OpenRead(path))
            {
                var decoded  = LZ4Frame.Decompress(fs);
                var encoded  = LZ4Frame.Compress(new MemoryStream(decoded), useContentSize: false);
                var decoded2 = LZ4Frame.Decompress(new MemoryStream(encoded));
                Assert.IsTrue(decoded2.SequenceEqual(decoded));
                //var canRead = fs.CanRead;
            }
        }