Java Unzip InputStream decompress(InputStream inputStream)

Here you can find the source of decompress(InputStream inputStream)

Description

decompress

License

Open Source License

Declaration

public static InputStream decompress(InputStream inputStream)
            throws IOException 

Method Source Code

//package com.java2s;
import java.io.BufferedInputStream;

import java.io.IOException;
import java.io.InputStream;
import java.util.zip.GZIPInputStream;

public class Main {
    public static InputStream decompress(InputStream inputStream)
            throws IOException {
        inputStream = new BufferedInputStream(inputStream);
        inputStream.mark(1024);//from   w  w  w .ja  va 2s.  com
        try {
            inputStream = new GZIPInputStream(inputStream);
        } catch (IOException e) {
            inputStream.reset();
        }
        return inputStream;
    }
}

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 is, OutputStream os)
  5. decompressFile(InputStream is, OutputStream os)
  6. decompressStream(InputStream input)
  7. decompressZipArchive(final File zipFile, final File rootDirectoryToUnZip)