size « Zip « Java I/O Q&A





1. What is the buffer size to create a .zip archive using Java?    stackoverflow.com

I use this code to create a .zip with a list of files:

ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile));

for (int i=0;i<srcFiles.length;i++){
    String fileName=srcFiles[i].getName();
    ZipEntry zipEntry = ...

2. How to estimate zip file size in java before creating it    stackoverflow.com

I am having a requirement wherein i have to create a zip file from a list of available files. The files are of different types like txt,pdf,xml etc.I am using java ...

4. java.util.zip.ZipException: invalid entry size - while deploying to remote machine    coderanch.com

Hi, I am trying to deploy my app via JNLP but I run into strange errors while using linux server (Ubuntu). I am using com.sun.javaws.servlet.JnlpDownloadServlet to serve JNLP files. Everything works perfect when deploy app to local JBoss on Windows7, but the same code deployed on the remote Linux machine causes strange error: java.util.zip.ZipException: invalid entry size (expected 26915 but got ...

5. Zipped file size is larger then original file    coderanch.com

Hi, I have a problem in zipping files although program is running fine but as i zip the file the size of the file in zipped folder is larger then the actual file . I dont know what actually is the problem please help me out Below is my code. try { String path = new java.io.File(".").getCanonicalPath(); //String parentPath = path.substring(0,path.lastIndexOf("\\")); ...

6. size of a ZipEntry    coderanch.com

All, I ran into this issue that the size (compressed, uncompressed) etc.. are not getting updated after the data has been written and the ZipEntry is closed in the ZipOutputStream (those fields should be updated automatically). That is, upon reading the entire zip file back it returns -1 (for getSize(), etc...) always for each file written. Any tips/help on this?

7. Writing zip files results in a zip file with a size, but no files when i open it    java-forums.org

public void addFile(File directory, ZipOutputStream out) throws IOException { File[] filenames = directory.listFiles(); byte[] b = new byte[1024]; for (int i = 0; i < filenames.length; i++) { if (filenames[i].isDirectory()) { addFile(filenames[i], out); continue; } FileInputStream in = new FileInputStream(filenames[i].getAbsolutePath()); System.out.println(" Adding: " + filenames[i].getAbsolutePath()); out.putNextEntry(new ZipEntry(filenames[i].getAbsolutePath())); int len; while ((len = in.read(b)) > 0) { out.write(b, 0, len); } out.closeEntry(); ...

8. How do I store and retrieve the uncompressed file size of a .zip file?    forums.oracle.com

Thanks guys, I got it working now, but now that I understand the bug I'm still having another problem with the progress bar. I need to decompress multiple zip files at a time and I have one pregress bar for the current archives progress and another for the overall progress, in order to get uncompressed size of every archive am I ...

9. Setting the files original size in ZipEntry    forums.oracle.com

I need to create a ZipEntry with the correct original size. I've tried setting it using setSize() but it gets ignored. I've figured out that the reason it gets ignored is because I haven't specified the CompressedSize and the CRC value as well... .mental! If I do the compression in 2 passes, I can find out the compressed size but where ...





10. What is the max size of a zip file with the JDK1.5 ?    forums.oracle.com

Hello everybody, I'm a french student and for a project, I need to create a zip file, but I don't know in advance the number and the size of files to include in my zip. I wish to know if someone have the answer to my question : what is the max size of a zip file with the JDK1.5 ? ...

11. Is there some kind of file size limitation to Java's zip package?    forums.oracle.com

Of course java zip isn't winzip. You might have found a bug. You should try reducing your original file to the point where the output is slightly less than 2 gigs. If that works then increase it to just over 2 gigs (output) and see if that fails. If that doesn't work then try reducing the input file to just under ...