Java Unzip File decompressFile(File destFile, ZipInputStream zis)

Here you can find the source of decompressFile(File destFile, ZipInputStream zis)

Description

decompress File

License

Open Source License

Declaration

private static void decompressFile(File destFile, ZipInputStream zis) throws Exception 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.BufferedOutputStream;
import java.io.File;

import java.io.FileOutputStream;

import java.util.zip.ZipInputStream;

public class Main {
    private static final int BUFFER = 1024;

    private static void decompressFile(File destFile, ZipInputStream zis) throws Exception {

        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(destFile));

        int count;
        byte data[] = new byte[BUFFER];
        while ((count = zis.read(data, 0, BUFFER)) != -1) {

            bos.write(data, 0, count);//from w w  w  . j av  a2 s .c  o  m
        }

        bos.close();
    }
}

Related

  1. decompress(String fileName, String destinationFolder)
  2. decompress(String filepath, File outpathdir, String includes)
  3. decompress(String zipFile, String targetPath)
  4. decompresses(File file, File destinationDirectory)
  5. decompressFile(final File toDecompress, final File destinationFile)
  6. decompressFile(String inName)
  7. decompressGzip(File src, File trgt)
  8. uncompress(ByteArrayInputStream bais)