Code example for Deflater

0
     
    public ZioEntryOutputStream( int compression, OutputStream wrapped) 
    { 
        this.wrapped = wrapped;
        if (compression != 0)
            downstream = new DeflaterOutputStream( wrapped, new Deflater( Deflater.BEST_COMPRESSION, true));
        else downstream = wrapped;
    } 
     
    public void close() throws IOException { 
        downstream.flush();
        downstream.close();
        crcValue = (int)crc.getValue();
    } 
 
    public int getCRC() { 
        return crcValue;
    } 
     
    public void flush() throws IOException { 
        downstream.flush();