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: