Code example for CRC32

Methods: reset

0
 */ 
public class GZIPOutputStreamEx extends DeflaterOutputStream {
    /** 
     * CRC-32 of uncompressed data. 
     */ 
    protected CRC32 crc = new CRC32();
 
    /* 
     * GZIP header magic number. 
     */ 
    private final static int GZIP_MAGIC = 0x8b1f;
 
    /* 
     * Trailer size in bytes. 
     */ 
    private final static int TRAILER_SIZE = 8;
 
    /** 
     * Creates a new output stream with the specified buffer size. 
     *  
     * @param out 
     *            the output stream 
     * @param size 
     *            the output buffer size 
     * @exception IOException 
     *                If an I/O error has occurred. 
     * @exception IllegalArgumentException 
     *                if size is <= 0 
     */ 
    public GZIPOutputStreamEx(OutputStream out, int size, int compressLevel) throws IOException {
        super(out, new Deflater(compressLevel, true), size);
        // usesDefaultDeflater = true; 
        // writeHeader(); 
        crc.reset();
    } 
 
    /** 
     * Creates a new output stream with a default buffer size. 
     *