public static byte [ ] gunzipBytes ( byte [ ] compressedBytes ) throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream ( ( int ) ( compressedBytes . length * 1.5 ) ) ; InflaterOutputStream dos = new InflaterOutputStream ( bos ) ; dos . write ( compressedBytes ) ; dos . close ( ) ; return bos . toByteArray ( ) ; }
to avoid linking all that jazz into the client code