Code example for GZIPInputStream

Methods: close

-1
        if (uncompressed.getName().endsWith(".gz"))
            throw new IOException(String.format("Refusing to compare an uncompressed file that ends with .gz: %s", uncompressed.getAbsolutePath()));
        if (!gzippedTemp.getName().endsWith(".gz.temp"))
            throw new IOException(String.format("Refusing to compare a gzip file that does not end with .gz.temp: %s", gzippedTemp.getAbsolutePath()));
        FileInputStream uncompressedStream = new FileInputStream(uncompressed);
        GZIPInputStream gzipStream = new GZIPInputStream(new FileInputStream(gzippedTemp));
        try { 
            try { 
                return IOUtils.contentEquals(uncompressedStream, gzipStream);
            } finally { 
                gzipStream.close();
            } 
        } finally { 
            uncompressedStream.close();
        } 
    } 
 
    /** 
     * Reads the entire contents of a gzipped file into memory as a String. 
     * UTF-8 encoding is assumed. 
Connect your IDE to all the code out there  Get Codota for Java