Here you can find the source of uncompressGzip(byte[] b)
public static byte[] uncompressGzip(byte[] b) throws IOException
//package com.java2s; /******************************************************************************* * Copyright (c) 2010-2015 BSI Business Systems Integration AG. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:/*from ww w. j ava 2s . c o m*/ * BSI Business Systems Integration AG - initial API and implementation ******************************************************************************/ import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.zip.GZIPInputStream; public class Main { public static byte[] uncompressGzip(byte[] b) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(); try (BufferedInputStream in = new BufferedInputStream(new GZIPInputStream(new ByteArrayInputStream(b)))) { int val; while ((val = in.read()) >= 0) { out.write(val); } } return out.toByteArray(); } }