给现有的.Net项目增加安卓平台客户端, 目前使用的 ComponentAce.Compression.Libs.zlib 压缩解压字节流
C#代码片段:
...
ZOutputStream outZStream = new ZOutputStream(outStream);
CopyStream(inStream,outZStream);
...
安卓客户端使用java开发 ,java压缩字节流网上找到的大部分方法都是用java.util.zip.ZipOutputStream,
代码片段:
...
ZipOutputStream zout = new ZipOutputStream(out);
zout.putNextEntry(new ZipEntry(""));
zout.write(bytes);
...
但是这样压缩之后,C#的zlib无法解压, "...inflating: unknown compression method"
最后终于在下面博客找到了方法, 用java.util.zip.Deflater压缩,C#就能解压了