Code example for Inflater

0
        hex.append("0xf2 0x00 0x11 0x00 0x00");
 
        byte compressed[] = Hex.dehex(hex);
 
        ByteArrayOutputStream bout = new ByteArrayOutputStream(64);
        InflaterOutputStream inflater = new InflaterOutputStream(bout,new Inflater(true));
 
        try 
        { 
            inflater.write(compressed,0,compressed.length);
 
            byte buf[] = bout.toByteArray();
            String actual = new String(buf,Charset.forName("UTF-8"));
            System.out.printf("Actual: \"%s\"%n",actual);
        } 
        catch (Throwable t)
        { 
            t.printStackTrace();
        } 
    } 
Contextual code suggestions in your IDE  Get Codota for Java