Hi Dale,

Thank you for your reply.

It sounds I can make it, even though there might be some problems about
closing streams.
When I coded like the following, I could get the download file(i.e. I could
concatenate the ByteArrayInputStream objects.
)

Note.I must rely on SequenceInputStream refered by strtus2 to close all
streams,even though it is possible SequenceInputStream.close(=nextStream)
not to try to close all streams by throwing IOException.   

#### code #####
    SequenceInputStream seq1 = null;
    
    ByteArrayInputStream bai1 = null;
    ByteArrayInputStream bai2 = null;
    ByteArrayInputStream bai3 = null;
    
    try {
       String str1 = new String("aaa");
       bai1 = new ByteArrayInputStream(str1.getBytes("UTF-8"));
            
       String str2 = new String("bbb");
       bai2 = new ByteArrayInputStream(str2.getBytes("UTF-8"));
       seq1 = new SequenceInputStream(bai1, bai2);

       String str3 = new String("ccc");
       bai3 = new ByteArrayInputStream(str3.getBytes("UTF-8"));
            
       this.inputStream = new SequenceInputStream(seq1, bai3);
        } catch (UnsupportedEncodingException e) {
           
            e.printStackTrace();
        }finally{
           //don't close streams(seq1, bai1, bai2, bai3) 
        }
   }
###############

Thanks.

Ken

--- Dale Newfield <d...@newfield.org> wrote:

> java.io.SequenceInputStream might prove helpful to you here, as well.
> 
> -Dale
> 
> ---------------------------------------------------------------------
> 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