Using ZLib



Hi,

I'm trying to use the ZLib units supplied with Delphi to decompress a
file. So far I've got the following test procedure:

procedure TForm1.Button1Click(Sender: TObject);
var FS1, FS2: TFileStream;
ZS: TDecompressionStream;
begin
FS1:=TFileStream.Create(ExtractFilePath(ParamStr(0))+'test.zlb',
fmOpenRead);
ZS:=TDecompressionStream.Create(FS1);
FS2:=TFileStream.Create(ExtractFilePath(ParamStr(0))+'test.bin',
fmCreate);
FS2.CopyFrom(ZS, 0);

FS1.Free();
FS2.Free();
ZS.Free();
end;

This doesn't work, because the length of the TDecompressionStream can't
be read. So how can I decompress this file?

Also, how can I create a array or list of an arbritrary number of
record types, that is not known before the program is run?

TIA,
- QS Computing.

.