Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Cannot Reproduce
-
1.0
-
None
-
None
-
Apache Maven 2.2.0 (r788681; 2009-06-26 15:04:01+0200)
Java version: 1.6.0_14
Java home: /opt/jdk1.6.0_14/jre
Default locale: fr_FR, platform encoding: UTF-8
OS name: "linux" version: "2.6.30.5-28.rc2.fc11.i586" arch: "i386" Family: "unix"In POM :
<dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-compress</artifactId> <version>1.0</version> <type>jar</type> <scope>compile</scope> </dependency>
Apache Maven 2.2.0 (r788681; 2009-06-26 15:04:01+0200) Java version: 1.6.0_14 Java home: /opt/jdk1.6.0_14/jre Default locale: fr_FR, platform encoding: UTF-8 OS name: "linux" version: "2.6.30.5-28.rc2.fc11.i586" arch: "i386" Family: "unix" In POM : <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-compress</artifactId> <version>1.0</version> <type>jar</type> <scope>compile</scope> </dependency>
Description
While trying to decompres gzipped data with random removed bytes, no exceptions are thrown. Same file with zcat command line utility produces error below
gzip: badfiles-red-64/data.txt.gz: invalid compressed data--crc error gzip: badfiles-red-64/data.txt.gz: invalid compressed data--length error
The code below should throw an exception about corrupted file
Sample extraction code
CompressorInputStream cis = null; try { cis = new CompressorStreamFactory().createCompressorInputStream( "gz", new FileInputStream("badfiles-red-64/data.txt.gz")); } catch (CompressorException e) { // This will never happen unless "gz" is changed 2 lines above log.error(e.getMessage(), e); throw new ProcessingException(e); } try { while (cis.read() > 0) { } } catch (IOException e) { log.error(e.getMessage(), e); throw new ProcessingException(e); }