program test_zip;
{$APPTYPE CONSOLE}
uses
  System.SysUtils, System.Classes, System.Zip;

var
  LZip: TZipFile;
  LStream: TStringStream;
  LZipPath: string;
begin
  LZipPath := ExtractFilePath(ParamStr(0)) + 'test_stream.zip';
  Writeln('Creating zip at: ' + LZipPath);
  LZip := TZipFile.Create;
  try
    LZip.Open(LZipPath, zmWrite);
    LStream := TStringStream.Create('Hello OpenXML', TEncoding.UTF8);
    try
      LZip.Add(LStream, 'test.txt');
    finally
      LStream.Free;
    end;
    LZip.Close;
    Writeln('Stream zip success!');
  finally
    LZip.Free;
  end;
end.
