Biterider,
    In the Init method of the MemoryStream object, what is the dDelta argument used for?
Thanks,
    Rags
Posted on 2006-05-16 13:12:14 by rags
Hi Rags
In some cases, the original capacity defined in the Init method of a MemoryStream has to be increased. I.e if you use the BufferLoad method with a buffer that is larger than the stream capacity, the stream has to be resized to fit it. The dDelta parameter defines the increment (in bytes) used to enlarge the stream capacity.

Usually you know what you are handling when you use a stream so you can estimate the size of the data or structures it contains to set a proper dDelta value. If not, some experimentation with values like 100 to a page size can be helpful.

If you are familiar with collections, they use a similar concept to expand its capacity.

Regards,

Biterider
Posted on 2006-05-16 14:34:47 by Biterider
Biterider,
If I understand you correctly,dDelta is the amount of bytes,  repeatedly added to the dLimit  value, until the needed amount  or dMaxSize  is reached. Whichever comes first.
All of this occurs automatically in MemoryStream object.
Am I correct in my understanding?

Rags
Posted on 2006-05-16 20:19:45 by rags
Hi Rags
Yes, that's exactly how it works.

Biterider
Posted on 2006-05-17 01:27:22 by Biterider
Thank You! :D
Posted on 2006-05-17 06:19:34 by rags