title: How to use TDecompressionStream?
body: <p>I want to decompress a gzip data (a http message body), and I tried the following code, but it's not working, it rise an exception when I try to read from the stream. What is wrong ?</p>
  
  <pre><code>uses zlib;
  
  procedure TForm1.Button1Click(Sender: TObject);
  var InStream: TStream;
      ZStream: TDecompressionStream;
      s:string;
      x:int64;
  begin
   InStream:=TMemoryStream.Create;
  
   s:='...the gziped body here...';   //binary string
   InStream.Write(s[1],length(s));
   InStream.Seek(0, soFromBeginning);
  
   ZStream:=TDecompressionStream.Create(InStream);
   SetLength(s,10000);
   x:=ZStream.Read(s[1],10000);
   SetLength(s,x);
  
   Label1.Caption:=s;
  
   InStream.Free;
   ZStream.Free;
  end;
  </code></pre>