Java GZIPInputStream Create getGZipInputStream(InputStream in)

Here you can find the source of getGZipInputStream(InputStream in)

Description

Returns a Gzip input stream wrapping given input stream.

License

GNU General Public License

Parameter

Parameter Description
in The raw input stream

Exception

Parameter Description
IOException if an I/O error has occurred

Return

a Gzip input stream wrapping given input stream, or null if in is null

Declaration

public static GZIPInputStream getGZipInputStream(InputStream in) throws IOException 

Method Source Code

//package com.java2s;
// License: GPL. For details, see LICENSE file.

import java.io.IOException;
import java.io.InputStream;

import java.util.zip.GZIPInputStream;

public class Main {
    /**/*from w  w w.  j  av  a 2s .  c o  m*/
     * Returns a Gzip input stream wrapping given input stream.
     * @param in The raw input stream
     * @return a Gzip input stream wrapping given input stream, or {@code null} if {@code in} is {@code null}
     * @throws IOException if an I/O error has occurred
     * @since 7119
     */
    public static GZIPInputStream getGZipInputStream(InputStream in) throws IOException {
        if (in == null) {
            return null;
        }
        return new GZIPInputStream(in);
    }
}

Related

  1. getGZIPDecompressStream(byte[] buffer)
  2. getGzipInputStream(File file)