File inputFile, File outputFile ) throws
Exception {
BufferedInputStream in = null;
GZIPOutputStream out = null;
try {
in = new BufferedInputStream( new FileInputStream(inputFile));
out = new GZIPOutputStream( new FileOutputStream(outputFile));
byte buffer[] = new byte[1024];
int bytesRead;
while ( (bytesRead = in.read(buffer)) != -1) {
out.write(buffer, 0, bytesRead);
}
} catch (Exception e) {
throw e;
} finally {
try { in.close(); } catch( Exception e) {}
try { out.close(); } catch( Exception e) {}
}
}