The ByteArrayOutputStream is closed not nulled. GC will not get it, use it
at will.

Best Regards,
Paulo Soares

----- Original Message -----
From: "NGUYEN LIEM (APP1LXN)" <[EMAIL PROTECTED]>
To: "Paulo Soares" <[EMAIL PROTECTED]>; "Grzegorz Kucner"
<[EMAIL PROTECTED]>
Sent: Tuesday, August 20, 2002 17:23
Subject: RE: [iText-questions] RE: Create PDF In Memory


> Greg + Paulo Soares,
>
> Thanks for responding.
>
> When I test getting the pdf document from ByteArrayOutputStream after
> document.close(), I don't see any problem. But if calling document.close()
> will close my ByteArrayOutputStream, then if I get pdf document after my
> ByteArrayOutputStream has been closed, do you know if the result I get is
> right? because I am afraid if Garbage Collection collects my
> ByteArrayOutputStream object before I get my pdf document, then the pdf
> document is not good.
>
> Again, thanks for helping.
>
> Liem,
>
>
>
>
> -----Original Message-----
> From: Paulo Soares [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 20, 2002 12:06 PM
> To: NGUYEN LIEM (APP1LXN); [EMAIL PROTECTED]
> Subject: Re: [iText-questions] RE: Create PDF In Memory
>
>
> What's the problem of getting the pdf document from ByteArrayOutputStream
> after close()?
>
> Best Regards,
> Paulo Soares
>
> ----- Original Message -----
> From: "NGUYEN LIEM (APP1LXN)" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, August 20, 2002 16:44
> Subject: [iText-questions] RE: Create PDF In Memory
>
>
> > > Hi Everyone,
> > >
> > > Can you tell me how to build a PDF Document in memory. If I use
> > > ByteArrayOutputStream to create OutputStream and pass this
> > outputStream to
> > > PdfWriter.getInstance, then I can have a PDF Document in memory.
> > However,
> > > after building the document, I have to call document.close() and in
> > the
> > > tutorial, It said calling document.close() will flush and close the
> > > outputstream to which the writer is writing. I have tried to get the
> > PDF
> > > Document from my ByteArrayOutputStream  before call document.close()
> > but
> > > what I get is an uncompleted document.
> > >
> > > (Concat.java)
> > >
> > > ...
> > > Document document = new Document(reader.getPageSizeWithRotation(1));
> > > ByteArrayOutputStream pdfOutputStream = new ByteArrayOutputStream();
> > > PdfWriter writer = PdfWriter.getInstance(document, pdfOutputStream);
> > >
> > > ....
> > >
> > > byte [] tempPDF = pdfOutputStream.toByteArray();
> > > document.close(); // this will close my ByteArrayOutputStream (???)
> > >
> > >
> > > Do you have any idea,
> > >
> > > Thanks
> > >
> > > Liem
> > >
> > >
> > >
> >
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by: OSDN - Tired of that same old
> > cell phone?  Get a new here for FREE!
> > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
> > _______________________________________________
> > iText-questions mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/itext-questions




-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to