Ok, it works now. For the records, I've used the lib http://www.gocher.me/GZIP (Silvio's tip) and the function Base64Decode from WST framework http://svn.code.sf.net/p/lazarus-ccr/svn/wst/trunk/
For some reason the function DecodeBase64 from Synapse doesn't work. It receives an AnsiString. Instead, the Base64Decode function receives a TByteDynArray. The TDataStream class doesn't matter... So, the code below is ugly, but shows how it works now (before the refactoring). Thank you all for the help. === begin === procedure TMainForm.Button2Click(Sender: TObject); var Buf,Buf2: TMemoryStream; B: TByteDynArray; begin Buf := TMemoryStream.Create; Buf2 := TMemoryStream.Create; try Buf.LoadFromFile('result.txt'); B := Base64Decode(TDataStream.New(Buf).AsString, [xoDecodeIgnoreIllegalChar]); Buf.SaveToFile('bytes.txt'); Buf.Clear; Buf.WriteBuffer(Pointer(B)^, Length(B)); if ZUncompressStream(Buf, Buf2) then Buf2.SaveToFile('content.txt'); finally Buf.Free; Buf2.Free; end; end; === end === Best regards, Marcos Douglas _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal