> When a XML comes to the parser sometimes it doesn't know the length of
> the buffer containing the XML i.e. XML is in a file. So at the
> beginning parser allocates a buffer (of predefined size) and if this
> buffer is not enough when reading the XML, it reallocates the buffer
> again.

Rather than realllocating the buffer, you can use an arry of buffers.
This way you would not loose the origanally parsed buffer, and if it
does not have enough room, then allocate a new buffer and read the rest
of XML to this new buffer.

Ofcource you need to put some effort to manage the array of buffers
properly, but I think you can do that using a very simple algorithm.


As suggested above multiple buffer solution seems to be the best. Also
I think its performance is better than the reallocation of the
buffers. So I will implement that.

Regards,
Supun.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to