GetResponseStream static method
Gets the response stream (may be wrapped with GZip/Deflate stream to decompress content)
HttpWebResponse.
Implementation
static Stream GetResponseStream(IEwsHttpWebResponse response) {
String contentEncoding = response.ContentEncoding;
Stream<List<int>> responseStream = response.GetResponseStream();
if (contentEncoding.toLowerCase().contains("gzip")) {
return GZipCodec().decoder.bind(responseStream);
return responseStream;
// return responseStream.transform(gzip.decoder);
// return new GZipStream(responseStream, CompressionMode.Decompress);
} else if (contentEncoding.toLowerCase().contains("deflate")) {
return ZLibDecoder().bind(responseStream);
// return new DeflateStream(responseStream, CompressionMode.Decompress);
} else {
return responseStream;
}
}