public void gzPressFile(String sourcePathAndName ,String pressPathAndName ){ try { BufferedReader in = new BufferedReader(new FileReader(sourcePathAndName));
BufferedOutputStream out = new BufferedOutputStream( new GZIPOutputStream(new FileOutputStream(pressPathAndName))); int c; while ((c = in.read()) != -1) { out.write(c); } in.close(); out.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } }