Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Feb : Re: Reading the data off a buffer.
| Subject: | Re: Reading the data off a buffer. |
| Posted by: | "Remy Lebeau (TeamB)" (no.spam@no.spam.com) |
| Date: | Thu, 22 Feb 2007 10:12:28 |
"Graham Harris" <ng@bmsgharr.globalnet.co.uk> wrote in message
news:45dd88ba$1@newsgroups.borland.com...
> After the XML Document the client of this legacy stream
> sends #13#13 at the end of the buffer.
Then you can pass #13#13 as the terminator string to Indy's ReadLn()
method. As long as #13#13 does not appear anywhere inside the XML
data, then you will be fine:
procedure GetData(IO: TIdIOHandler; Data: TStream);
var
S: String;
begin
S := IO.ReadLn(#13#13);
if Length(S) > 0 then Data.Write(S[1], SizeOf(Char) *
Length(S));
end;
Gambit
none