Output to input stream for streaming?

2009-08-10 Thread Martin Makundi
Hi! I have a HSSF document which can be written to an output stream. However, I want to stream it to the website visitor, which requires an inputstream... I have tried the following, but it somehow doesn't seem to work. Anybody know what can be done to fix it? final PipedInputStream

RE: Output to input stream for streaming?

2009-08-10 Thread Russell Simpkins
Martin, I don't think you can do this in a thread because that lets the HttpServletResponse end and close your ServletOutputStream. Russ Date: Mon, 10 Aug 2009 14:49:58 +0300 Subject: Output to input stream for streaming? From: martin.maku...@koodaripalvelut.com To: users

Re: Output to input stream for streaming?

2009-08-10 Thread Reinhard Nägele
How about this: ByteArrayOutputStream baos = new ByteArrayOutputStream(); wb.write(baos); InputStream is = new ByteArrayInputStream(baos.toByteArray()); Martin Makundi schrieb: Hi! I have a HSSF document which can be written to an output stream. However, I want to stream it to the website

RE: Output to input stream for streaming?

2009-08-10 Thread Russell Simpkins
thing that happens is the output stream gets closed. Try doing the write outside of a thread and see if you get the same exception. Russ Date: Mon, 10 Aug 2009 15:03:13 +0300 Subject: Re: Output to input stream for streaming? From: martin.maku...@koodaripalvelut.com To: users@wicket.apache.org

Re: Output to input stream for streaming?

2009-08-10 Thread Martin Makundi
Maybe the thread is wrongly written, yes but a servlet CAN read a FILE. A file is always another PROCESS (which supplies the file contents, yes, it's the disk driver etc.). So a similar configuration should be possible between a write operation and an input stream. Anybody have experience with

Re: Output to input stream for streaming?

2009-08-10 Thread Erik van Oosten
With 'output' I meant the servlet request output. But perhaps I misunderstood the question. I guess the problem is that you close 'inputStream' as soon as the request is finished. The thread that tries to write to it is still active at that moment. Regards, Erik. Martin Makundi wrote:

RE: Output to input stream for streaming?

2009-08-10 Thread Russell Simpkins
anything to the output stream. russ Date: Mon, 10 Aug 2009 18:10:13 +0300 Subject: Re: Output to input stream for streaming? From: martin.maku...@koodaripalvelut.com To: users@wicket.apache.org Ouch.. Could I make the READ a blocking one... thus it would wait until the source is really