ppkarwasz commented on PR #701:
URL: https://github.com/apache/commons-compress/pull/701#issuecomment-3238321296

   > Are the implementations in DEFLATE, DEFLATE64, and BZip2 identical? Do we 
know the specs for these formats well enough to have confidence that we won't 
end up back where we started, accommodating tweaks, features, or oddities that 
are format-specific? We'll only know some of this as this refactoring proceeds.
   
   They aren’t identical end-to-end, but they share the same **canonical 
Huffman decoding primitive**: given an array of code lengths, map an LSB/MSB 
bitstream to symbols. This PR extracts just that primitive into a reusable 
`HuffmanDecoder`. Format-specific parts remain outside (block structure, 
alphabets, extra bits, selectors, etc.).
   
   I have also refactored the DEFLATE64 implementation, so this PR is ready for 
a review.
   
   > I don't think we need a new package called "alg", especially with a single 
class in it. If this new class is designed for reuse among compressors, then is 
can go in "compressors". Or "hufman" if we end up with more classes.
   
   Agreed. I moved the class to `compressors.support` for now. If we don’t want 
it as public API, I can relocate to an `internal` package (and mark as non-API 
in module/OSGi metadata).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to