Android InputStream Unzip decompressFile(File destFile, ZipInputStream zis)

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

Description

decompress File

Declaration

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

Method Source Code

//package com.java2s;
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   www  .  jav a2  s. c  o  m
        }

        bos.close();
    }
}

Related

  1. uncompress(InputStream inputStream)
  2. unpackZip(Context context, String s, InputStream is)
  3. readEntryAsWhatEverInternal( final ZipEntry entry, final InputStream unzippedInputStream)
  4. getZipFileList(InputStream is)
  5. extZipFile(InputStream is, String extPlace)