Question

I want to encode a stream but something doesn't work. After encoding the output stream is empty:

procedure TForm5.Button1Click(Sender: TObject);
VAR s: String;
    InpStream, OutStream: TMemoryStream;
begin
 InpStream:= TMemoryStream.Create;
 OutStream:= TMemoryStream.Create;

 s:= 'zzzzzzzzzzzzzzzz'+CRLF+'zzzzzzzzzzzzzzzz';
 InpStream.WriteBuffer(s[1], Length(s));                  <---- after this, Size of Inpstream is 34

 EncdDecd.EncodeStream(InpStream, OutStream);

 if OutStream.Size<= 0
 then EmptyDummy;              <------- OutStream.Size is zero!

 FreeAndNil(InpStream);
 FreeAndNil(OutStream);
end;

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top