[ 
https://issues.apache.org/jira/browse/COMPRESS-263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14033426#comment-14033426
 ] 

Stefan Bodewig commented on COMPRESS-263:
-----------------------------------------

Well, that's only four bits of the first byte, this is bound to cause a lot of 
false positives so we better don't go that route IMHO.  Thanks for your 
investigation.

Counting on the output side should be easy, but interestingly the other 
compression format don't seem to do this either (only the archivers do).  So 
let's skip that for deflate.  I also only now realized  
XZCompressorInputStream's count is doing just what you have implemented as 
well, I'll look into it myself.  There is 
org.apache.commons.compress.utils.CountingInputStream that used to be wrapped 
around the original input for some formats but no longer seems to be used.

Re: withZlibHeader - see svn revision 1603054

> Add DEFLATE support
> -------------------
>
>                 Key: COMPRESS-263
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-263
>             Project: Commons Compress
>          Issue Type: New Feature
>          Components: Compressors
>            Reporter: Matthias Stevens
>              Labels: features
>             Fix For: 1.9
>
>         Attachments: COMPRESS-263_DeflateSupport.patch, 
> COMPRESS-263_DeflateSupport_v1.1.patch, bla.tar.deflate, bla.tar.deflatez
>
>
> GZIP is not a compression algorithm "as such". The de facto (and currently 
> the only supported) compression algorithm it uses is DEFLATE.
> GZIP adds a header of minimum 10 bytes and a footer of 8 bytes to a 
> "deflated" data stream. Find out more here: 
> http://en.wikipedia.org/wiki/Gzip#File_format
> I have no problem with the current GZIP support, but it would be nice if 
> CommonsCompress would also have compression and decompression support for 
> "raw" DEFLATE streams and DEFLATE streams with the zlib header.
> Similarly to the GZIP support in CommonsCompress these functionality can be 
> implemented very easily using the standard java.util.zip package, as done in 
> the provided patch.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to