Skip to content
Advertisement

java Extracting Zip file

I’m looking for a way to extract Zip file. So far I have tried java.util.zip and org.apache.commons.compress, but both gave a corrupted output.

Basically, the input is a ZIP file contain one single .doc file.

java.util.zip: Output corrupted. org.apache.commons.compress: Output blank file, but with 2 mb size.

So far only the commercial software like Winrar work perfectly. Is there a java library that make use of this?

This is my method using java.util library:

JavaScript

}

Many thanks, Mike

Advertisement

Answer

It is an error in my code. I need to specify the offset and len of bytes write.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement