It is as Lukas Pokorny wrote in comment, the length of decompressed data is not known until whole response is decompressed. There is no HTTP header which contain such value.
I ensured that Rebex has exact same behavior as System.Net.HttpWebRequest
class using http://httpbin.org/gzip and this code:
var request = (HttpWebRequest)WebRequest.Create("http://httpbin.org/gzip");
request.AutomaticDecompression = DecompressionMethods.GZip;
using (var response = request.GetResponse())
{
Console.WriteLine("ContentLength: {0}", response.ContentLength);
using (var reader = new StreamReader(response.GetResponseStream()))
{
string body = reader.ReadToEnd();
Console.WriteLine("Body length: {0}", body.Length);
}
Console.WriteLine("ContentLength: {0}", response.ContentLength);
}
The output of this program is:
ContentLength: -1
Body length: 166
ContentLength: -1