GZIPOutputStream gzip = null;
try {
os = new ByteArrayOutputStream();
gzip = new GZIPOutputStream(os);
gzip.write(data);
gzip.finish();
return new ByteArrayInputStream(os.toByteArray());
} finally {
ObjectHelper.close(gzip, "gzip", null);
ObjectHelper.close(os, "byte array", null);
}