Here you can find the source of gunzip(byte src[], byte default_value[])
static public byte[] gunzip(byte src[], byte default_value[])
//package com.java2s; //License from project: BSD License import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.util.zip.GZIPInputStream; import com.amazonaws.util.IOUtils; public class Main { static public byte[] gunzip(byte src[], byte default_value[]) { try {/*from www . j a v a 2s . c om*/ if (src == null) return default_value; ByteArrayOutputStream out = new ByteArrayOutputStream(); GZIPInputStream in = new GZIPInputStream(new ByteArrayInputStream(src)); IOUtils.copy(in, out); in.close(); out.close(); return out.toByteArray(); } catch (Exception e) { return default_value; } } }