Board index » delphi » Indy 9 to Indy 10 how to WriteStream?

Indy 9 to Indy 10 how to WriteStream?


2005-01-20 02:55:16 PM
delphi99
I use
TCPClient.WriteStream(AStream, AAll, AWriteByteCount, ASize);
in my Indy 9 project.
I found Indy 10 do not support writing TStream anymore, how to convert the code above to indy10?
Indy10 support write TIdStreamVCL, but how to use it to write a TStream?
TCPClient.IOHandler.Write(TIdStreamVCL
--
Samson Fu
 
 

Re:Indy 9 to Indy 10 how to WriteStream?

"Samson Fu" <XXXX@XXXXX.COM>writes
Quote
I found Indy 10 do not support writing TStream anymore,
Yes, it does. You just need to wrap the TStream into a TIdStreamVCL first,
ie:
var
IdStream: TIdStreamVCL;
IdStream := TIdStreamVCL.Create(AStream);
try
TCPClient.IOHandler.WriteStream(IdStream, AAll, AWriteByteCount,
ASize);
finally
FreeAndNil(IdStream);
end;
Quote
Indy10 support write TIdStreamVCL, but how to use it to write a TStream?
If you look at TIdStreamVCL, you will see that it takes a TStream as a
parameter in its constructor.
Gambit