This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
This is the code I am using to create a zip file with a pdf file.
The same code works fine when I create a zip file with a doc file.
When I open the pdf in the zip file, it says it is corrupted or damaged and cannot be opened.
What is the return value of fis.read(buf,0,buf.length)? Just because you try to read it all at once, don't assume that will succeed. You should always read data in a loop, and use the return value to determine what to write: