Read Compressed gz file. package com.pukhraj.blog; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; import java.util.zip.GZIPInputStream; public class ReadZipFile { public static void main(String[] args) { String FILENAME ="Path"; try{ FileInputStream fin = new FileInputStream(FILENAME); GZIPInputStream gzis = new GZIPInputStream(fin); InputStreamReader xover = new InputStreamReader(gzis); BufferedReader is = new BufferedReader(xover); String strLine; while ((strLine = is.readLine()) != null){ System.out.println(strLine); } }catch(FileNotFoundException e){ e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } }
Why does Java suck so much? Nope, It's too easy, If you have some experience. Is Java a dying technology? Nope, It's an stable language. Is Java good or bad? Very Good.