Here you can find the source of uncompress(byte[] input, int uncompr_len)
private static byte[] uncompress(byte[] input, int uncompr_len) throws IOException, DataFormatException
//package com.java2s; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.zip.DataFormatException; import java.util.zip.Inflater; public class Main { private static byte[] uncompress(byte[] input, int uncompr_len) throws IOException, DataFormatException { Inflater decompressor = new Inflater(); ByteArrayOutputStream bos = new ByteArrayOutputStream(uncompr_len); byte[] buf = new byte[uncompr_len]; decompressor.setInput(input);// ww w . ja va2s . c om while (!decompressor.finished()) { int count = decompressor.inflate(buf); if (count <= 0) { break; } bos.write(buf, 0, count); } decompressor.end(); return bos.toByteArray(); } }