Re: Buffering example for Indy 10

Giganews Newsgroups
Subject: Re: Buffering example for Indy 10
Posted by:  Remy Lebeau (TeamB) (
Date: Fri, 29 Jul 2005

"the bun" <rosario.carbo…> wrote in message

> My program seems to broken over a buffer size of 32k.

Then your program is doing something wrong.  Indy has no trouble with
buffers that large.  Please show your actual code.

> What is strange is that the write seems to write the right buffer size
> i.e. 100000 but the ReadBytes receive a buffer size for example of
> 24000 (I can't be precise at the moment) and seems to read about
> in the middle.

Again, please show your actual code.  You are likely not sending the data
property, and/or not reading it properly.

> What is strange is that Indy 10 has not an automatic buffering
> working with byte arrays

Indy does have support for byte arrays.  That is exactly what the TIdBytes
type is - an array of bytes.  Indy was specifically re-written in v10 to NOT
allow direct memory buffers to be sent/read anymore like in Indy 9.  You can
thank Microsoft's .NET for that, since such operations are not compatible
with .NET.  That is why the TIdBytes type exists now - its handling works
with .NET while still being cross-platform in general.  There are
RawToBytes() and BytesToRaw() functions available for converting memory
buffers to/from TIdBytes, however.



In response to

Buffering example for Indy 10 posted by the bun on Fri, 29 Jul 2005