Java GZIPInputStream Create getGzipInputStream(File file)

Here you can find the source of getGzipInputStream(File file)

Description

Returns a GZIPInputStream for a .gz file

License

Open Source License

Parameter

Parameter Description
file a parameter

Exception

Parameter Description
IOException an exception
FileNotFoundException an exception

Declaration

private static InputStream getGzipInputStream(File file) throws IOException, FileNotFoundException 

Method Source Code


//package com.java2s;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

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

import java.util.zip.GZIPInputStream;

public class Main {
    /**/*w ww. ja  v  a 2 s .co m*/
     * Returns a GZIPInputStream for a .gz file
     * 
     * @param file
     * @return
     * @throws IOException
     * @throws FileNotFoundException
     */
    private static InputStream getGzipInputStream(File file) throws IOException, FileNotFoundException {
        return new GZIPInputStream(new FileInputStream(file));
    }
}

Related

  1. getGZIPDecompressStream(byte[] buffer)
  2. getGZipInputStream(InputStream in)