public static void main(String[]str){
try{
String excelFile = "";
String gzipFile = "";
java.util.zip.GZIPOutputStream stream = new java.util.zip.GZIPOutputStream(new FileOutputStream(new File(gzipFile)));
java.io.FileInputStream fis = new java.io.FileInputStream(new File(excelFile));
byte[] buf = new byte[1024];
int len = 0;
while((len = fis.read(buf))>0){
stream.write(buf, 0, len);
}
stream.close();
}catch(Exception exp){
exp.printStackTrace(System.out);
}
}