Here you can find the source of uncompress(final byte[] src)
public static byte[] uncompress(final byte[] src) throws IOException
//package com.java2s; //License from project: Apache License import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.zip.InflaterInputStream; public class Main { public static byte[] uncompress(final byte[] src) throws IOException { byte[] result = src; byte[] uncompressData = new byte[src.length]; ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(src); InflaterInputStream inflaterInputStream = new InflaterInputStream(byteArrayInputStream); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(src.length); try {//from www .ja va2 s .c o m while (true) { int len = inflaterInputStream.read(uncompressData, 0, uncompressData.length); if (len <= 0) { break; } byteArrayOutputStream.write(uncompressData, 0, len); } byteArrayOutputStream.flush(); result = byteArrayOutputStream.toByteArray(); } catch (IOException e) { throw e; } finally { try { byteArrayInputStream.close(); } catch (IOException e) { } try { inflaterInputStream.close(); } catch (IOException e) { } try { byteArrayOutputStream.close(); } catch (IOException e) { } } return result; } }