Free Support Forum -

Memory management in aspose.pdf.kit

Hi there,

Using aspose objects you usually send an input stream and an output stream as arguments to the functions. (For example PdfFileStamp’s constructor).

Does the innerworkings of this object just copy the stream - or to rephrase my question - can I release the input stream sent to the object after calling the constructor ?


Hi Garker,

The input and output streams are not released until the processing is completed. So, you can’t release the input stream before completing the task. Once the process is complete and you call the Save or Close methods, as appropriate, only then the input and output stream will be completely ready for any other use etc. Please note that in some cases, you do not call the Save or Close method, but wait for the method to return i.e. Concatenate method.

I hope this helps. If you have any further questions, please do let us know.