Code example for Deflater

Methods: finishedsetLevel

0
             * Now this is tricky: We force the Deflater to flush its data by 
             * switching compression level. As yet, a perplexingly simple workaround 
             * for 
             * http://developer.java.sun.com/developer/bugParade/bugs/4255743.html 
             */ 
            if (!def.finished()) {
                def.setLevel(Deflater.NO_COMPRESSION);
                flushLastByte(); 
                def.setLevel(Deflater.DEFAULT_COMPRESSION);
            } 
        } 
        out.flush();
    } 
 
    /* 
     * Keep on calling deflate until it runs dry. The default implementation 
     * only does it once and can therefore hold onto data when they need to be 
     * flushed out. 
     */ 
    @Override 
    protected void deflate() throws IOException {