package readgzipfile;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.zip.GZIPInputStream;

public class ReadGZipViaStream2 {
	public static void main(String[] args) {
		String fileName = "sample.csv.gz";

		try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(
				new GZIPInputStream(ReadGZipViaStream2.class.getClassLoader().getResourceAsStream(fileName))))) {

			bufferedReader.lines().forEach(System.out::println);

		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
