if (isGzip(contentEncoding)) {
ByteArrayOutputStream os = new ByteArrayOutputStream();
GZIPOutputStream gzip = new GZIPOutputStream(os);
try {
IOHelper.copy(in, gzip);
gzip.finish();
return new ByteArrayInputStream(os.toByteArray());
} finally {
ObjectHelper.close(gzip, "gzip", null);
ObjectHelper.close(os, "byte array output stream", null);
}