I'm using ICSharpCode.SharpZipLib and doing the following: reading a file content, compressing (zlib) and then uploading to a server using HttpClient.PostAsync
My regular approach (as works for corresponding download) would be to create a compressed outputstream and then do Copy/CopyAsync from output to to a StreamContent. However, DeflaterOutputStream does not support reading, so this won't work. How should it be done effectively? It might just be only me, but the answer is not obvious.
I'm aware that I could compress file into memory first (ie. MemoryStream or byte array), and then copy those to http content, but that's not acceptable