Code example for Inflater

Methods: inflate, setInput

0
     * i.e., the same algorithms used to compress .jar files 
     */ 
    private static byte[] expand(byte[] bytes, int skip)
    { 
        byte[] newBytes = new byte[bytes.length - skip];
        Inflater inflater = new Inflater();
 
        inflater.setInput(bytes, skip, newBytes.length);
        try 
        { 
            int outCount = inflater.inflate(newBytes);
            System.arraycopy(newBytes, 0, bytes, skip, outCount);
            Arrays.fill(bytes, skip + outCount, bytes.length, (byte) 0);
            return bytes;
        } 
        catch (DataFormatException e)
        { } 
 
        return null; 
    }