I have a zip file physically stored in database.
I need to read the file from database and download it .
When I tried to get the data from database using getAsciiStream and wrote it using FileWriter zip file got created but unzipping the file gives error..
I also tried unzipping the zip file but that also gave an exception
If you attempt to present a ZIP file from a JSF view, JSF will corrupt it. Same for PDF's, Word documents, Excel spreadsheets and any other non-HTML file format. JSF is expecting to output HTML and only HTML.
Use an ordinary servlet to present the ZIP file for download. JSF is not greedy, it won't mind.
An IDE is no substitute for an Intelligent Developer.