Java Unzip InputStream decompressFile(InputStream is, OutputStream os)

Here you can find the source of decompressFile(InputStream is, OutputStream os)

Description

decompress File

License

BSD License

Declaration

public static void decompressFile(InputStream is, OutputStream os) 

Method Source Code


//package com.java2s;
//License from project: BSD License 

import java.io.*;

import java.util.zip.InflaterInputStream;

public class Main {
    public static void decompressFile(InputStream is, OutputStream os) {
        InflaterInputStream iis = new InflaterInputStream(is);
        try {/*from   ww w  . jav a2 s  . c o m*/
            int i = 1024;
            byte[] buf = new byte[i];

            while ((i = iis.read(buf, 0, i)) > 0) {
                os.write(buf, 0, i);
            }

        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}

Related

  1. decompress(ByteArrayInputStream xzStream)
  2. decompress(final int type, final InputStream is, final OutputStream os)
  3. decompress(InputStream input, File destDir)
  4. decompress(InputStream inputStream)
  5. decompress(InputStream is, OutputStream os)
  6. decompressStream(InputStream input)
  7. decompressZipArchive(final File zipFile, final File rootDirectoryToUnZip)
  8. unzip(InputStream from, String to, String pattern)
  9. unzip(InputStream in)