Java GZip gzipFileReader(String file)

Here you can find the source of gzipFileReader(String file)

Description

gzip File Reader

License

Open Source License

Declaration

public static BufferedReader gzipFileReader(String file) throws IOException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.BufferedReader;

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

import java.io.IOException;

import java.io.InputStreamReader;

import java.nio.charset.Charset;
import java.util.zip.GZIPInputStream;

public class Main {
    public static final Charset UTF8 = Charset.forName("UTF-8");

    public static BufferedReader gzipFileReader(String file) throws IOException {
        return new BufferedReader(new InputStreamReader(new GZIPInputStream(new FileInputStream(file)), UTF8));
    }/*  w w w  . ja v  a2  s. c o  m*/

    public static BufferedReader gzipFileReader(File file) throws IOException {
        return new BufferedReader(new InputStreamReader(new GZIPInputStream(new FileInputStream(file)), UTF8));
    }
}

Related

  1. gzip(final T o)
  2. gzip(String s)
  3. gzip(String str)
  4. gzipDecompress(byte[] compressed)
  5. gzipReader(final InputStream inputStream)
  6. gzipString(String src, byte default_value[])