We have already zip file in GZip format, lets unzip it
Example:
String INPUT_FILE = "/home/user/fileArchive.gz";
String OUTPUT_FILE = "/home/user/fileText.txt";
byte[] buffer = new byte[1024];
try{
GZIPInputStream gZIPInputStream = new GZIPInputStream(new FileInputStream(INPUT_FILE));
FileOutputStream fileOutputStream = new FileOutputStream(OUTPUT_FILE);
int len;
while ((len = gZIPInputStream.read(buffer)) > 0) {
fileOutputStream.write(buffer, 0, len);
}
gZIPInputStream.close();
fileOutputStream.close();
}catch(IOException ex){
ex.printStackTrace();
}