Hi Wielgus,

Thank you for the example.

That example you provided can work fine.
But I'm afraid I can not apply this way.

When using ByteArrayInputStream, I need to hold all contents of a download
file.But I must handle a huge file that can not be placed in memory.

I'm sorry that I did not tell exactly.

Thanks anyway.

--- Pawe娼ネ Wielgus <poulw...@gmail.com> wrote:

> Hi all,
> try this for example:
> 
> public InputStream getInputStream() throws ParseException,
> UnsupportedEncodingException {
>         StringBuffer sb = new StringBuffer("blablabla")
>         ....
>         return new
> ByteArrayInputStream(sb.toString().getBytes("windows-1250"));
> }
> 
> Best greetings,
> Paweセォ縞 Wielgus.
> 
> 
> 2010/9/16 Tommy Pham <tommy...@gmail.com>:
> >
> >> -----Original Message-----
> >> From: lunch...@yahoo.co.jp [mailto:lunch...@yahoo.co.jp]
> >> Sent: Wednesday, September 15, 2010 9:23 PM
> >> To: Struts Users Mailing List
> >> Subject: Re: How to download a file without creating it on a
> server
> >>
> >> Hi Dave and Allen,
> >>
> >> Thank you for quick reply.
> >>
> >> Frankly speaking, I'm not familiarity with using stream and could
> not come
> >> up with some ideas.
> >>
> >> When I coded with java.io.PipedInputStream/PipedOutputStream
> >> like follwoing, I could download an empty file with
> IllegalStateException.
> >>
> >> If anyone give an example how to code,I will really appreciate.
> >>
> >> Thanks.
> >>
> >>
> >
> > IIRC, Struts uses the Apache Commons FileUpload
> > http://commons.apache.org/fileupload/.
> > You could read more about the Streaming API with examples in the
> provided
> > link.
> >
> > Regards,
> > Tommy
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> 


--------------------------------------
Get the new Internet Explorer 8 optimized for Yahoo! JAPAN
http://pr.mail.yahoo.co.jp/ie8/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to