Hello,
Looking at this Compress method in BaseCompressor it creates a byte array, reads from the memory stream into that byte array, creates another memory stream from this byte array, and finally copies that new stream into the ‘destination’ stream.
This all seems unnecessary.
Copying directly from the compressed stream (mem) into the destination and all the tests pass.
//1. NOTE REALLY REQUIRED:
//var compressed = new byte[mem.Length];
//await mem.ReadAsync(compressed, 0, compressed.Length);
//var outStream = new MemoryStream(compressed);
//await outStream.CopyToAsync(destination);
//2. OR JUST:
await mem.CopyToAsync(destination);
Hello, Looking at this Compress method in BaseCompressor it creates a byte array, reads from the memory stream into that byte array, creates another memory stream from this byte array, and finally copies that new stream into the ‘destination’ stream.
This all seems unnecessary.
Copying directly from the compressed stream (mem) into the destination and all the tests pass.