Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ZipOutputStream to byte[]

843836Oct 15 2003 — edited Nov 21 2007
Hi, I�me trying to make a download of a zip file formated by me!!!

The return of my method(zip maker) is an output stream (ZipOutputStream) and i�d like to put this output stream into the ServletOutputStream to make the download, but the method write() of this outputStream takes only byte[], how can i do it???
I try to cast to an ByteArrayOutputStream, but it throws an ClassCastException, it�s the right approach???

There�s another way of doing it???

please help
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 19 2007
Added on Oct 15 2003
3 comments
2,724 views