Article View: borland.public.cppbuilder.internet.socket
Article #289replacing ReadBuffer in Indy10
From: Dennis Cote
Date: Thu, 20 Mar 2008 16:25
Date: Thu, 20 Mar 2008 16:25
30 lines
1518 bytes
1518 bytes
I am porting an application from Indy 9 to Indy 10.
In Indy 9 I had code to read data into a dynamically allocated char
buffer using ReadBuffer.
char* Buffer;
int Length;
...
ReadBuffer(Buffer, Length);
...
I have found that I need to do the following instead in Indy 10.
char* Buffer;
int Length;
...
TIdBytes byteBuf;
byteBuf.Length = Length;
IOHandler->ReadBytes(byteBuf, Length);
BytesToRaw(byteBuf, Buffer, Length);
...
My question is, is there a way to get Indy 10 to read directly into the
existing char buffer? I would like to avoid the extra allocations and
the buffer copy if possible.
TIA
Dennis Cote
Technical Details
Message-ID:
<47e28ff7$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!feeder.erje.net!news.isoc.lu!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 11508e,b74f9f50d42f1dea,start X-Google-Attributes: gid11508e,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Date: Thu, 20 Mar 2008 10:25:29 -0600 From: Dennis Cote <denniscote@gmail.com> User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.internet.socket Subject: replacing ReadBuffer in Indy10 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 142.179.167.5 Message-ID: <47e28ff7$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1206030327 142.179.167.5 (20 Mar 2008 09:25:27 -0700) Lines: 30 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!feeder.erje.net!news.isoc.lu!newsgroups.borland.com!not-for-mail