gets an InputStream from a file that is gzip compressed. - Java File Path IO

Java examples for File Path IO:GZIP

Description

gets an InputStream from a file that is gzip compressed.

Demo Code


//package com.java2s;
import java.io.*;
import java.util.zip.GZIPInputStream;

public class Main {
    /**//  ww  w  .ja va  2 s. c o  m
     * gets an InputStream from a file that is gzip compressed.
     *
     * @param file
     * @return
     * @throws IOException
     */
    public static InputStream getCompressedFileAsStream(final File file)
            throws IOException {
        return new GZIPInputStream(new BufferedInputStream(
                new FileInputStream(file)));
    }
}

Related Tutorials