GZip解压问题,JAVA压缩C#解压
java压缩代码:
...
InputStream stream = connection.getInputStream();
stream = new GZIPInputStream(stream);
....
通过POST传输
我的接收代码:
Stream stream = Request.InputStream;
GZipInputStream s = new GZipInputStream(stream);
using (GZipStream gzip = new GZipStream(stream, CompressionMode.Decompress))
{
using (StreamReader sr = new StreamReader(gzip))
{
input = sr.ReadToEnd();
}
}
报“GZip 头中的幻数不正确。请确保正在传入 GZip 流。”
求C#解压缩代码