Piped streams are supposed to be used by two threads. > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Geercken Uwe > Sent: Friday, December 17, 2004 2:52 PM > To: [EMAIL PROTECTED] > Subject: [iText-questions] outputstream/inputstream > > > I have created a wiki engine, that stores data in a mysql database and > dynamically creates html pages from the database, using servlets and > apache velocity. as the users shall be able to create pdf > from the wiki > pages, I convert the code from html to xml and from there to > itext using > the sax parser. right now I create a temporary xml file and > then feed it > to the sax parser. > > so far so good. but actually I do not want to create the xml > file but to > use an outputstream, inputstream. I tried using pipedoutputstream and > pipedinputstream, but when the pages are getting bigger in size, the > piping does not work - the process hangs: > > here is some code: > > File f = new File("tempcode.xml"); > Writer writer = new BufferedWriter(new FileWriter(f)); > writer.write(somedata); > ... > FileInputStream in = new FileInputStream(f); > XmlParser.parse(document, in); > > this works well. > > but what I really want to do is something like: > > PipedOutputStream out = new PipedOutputStream(); > PipedInputStream in = new PipedInputStream(out); > out.write(somedata); > XmlParser.parse(document, in); > > can somebody help me to set output/inputstream correctly up? > > thanks for your help. > > regards, > > uwe geercken > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from > real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > iText-questions mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/itext-questions >
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
