How To Unzip Large File With Java


public class UnZip {
   final static int BUFFER = 2048;
  // "/home/admin/Downloads/movies/"
   public String unzipFile(String compressFilePath, String uncompressFolderPath){
	   String uncompressedFilePath=null;
	   try {
	         BufferedOutputStream dest = null;
	         FileInputStream fis = new   FileInputStream(compressFilePath);
	         ZipInputStream zis = new     ZipInputStream(new BufferedInputStream(fis));
	         ZipEntry entry;
	         while((entry = zis.getNextEntry()) != null) {
	        	 System.out.println("Extracting: " +entry);
	            int count;
	            byte data[] = new byte[BUFFER];
	            // write the files to the disk
	            FileOutputStream fos = new 
	            dest = new 
	              BufferedOutputStream(fos, BUFFER);
	            while ((count =, 0, BUFFER)) 
	              != -1) {
	               dest.write(data, 0, count);
	      } catch(Exception e) {
	   return uncompressedFilePath;
   public static void main (String argv[]) {
	   //String destinationPath="/home/admin/Downloads/movies/";
	   UnZip unZip = new UnZip();

About lorddisk

WebCenter Content, WebCenter Portal, WebCenter Sites,Weblogic, Identity and Access Management (IAM),SSO,OAM,OIM,OAAM,OUD, OPAM,OID, OVD ,Oracle API Gateway ,OBIEE,OEDQ, Oracle ADF, Oracle SOA,J2EE, CackePHP ,PHP,J2SE,J2EE,Spring,Hibernate,JQuery,CSS,Java Script ,Joomla,Drupal,Worpress
This entry was posted in java and tagged , , . Bookmark the permalink.

1 Response to How To Unzip Large File With Java

  1. Swift Maxwell says:

    In the topic u mentioned large files.
    Can I know the limit that this program will work correctly?
    Because I need to retract a 25GB file.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.