commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Bourg <>
Subject Re: svn commit: r1551026 - in /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress: archivers/zip/ compressors/z/ compressors/z/
Date Wed, 18 Dec 2013 09:01:37 GMT
Le 18/12/2013 09:21, Stefan Bodewig a écrit :

> The end-of-information part could probably be dealt with in the subclass
> specific implementation of decompressNextSymbol and increasing the code
> size may happen in addEntry, not sure.  As for endianess, Emmanuel
> briefly mentioned a BitInputStream he had for the IMPLODE algortihm on
> IRC, maybe this could be used inside readNextCode and hide the concrete
> endianess?

I wrote two support classes to implement the explode algorithm:

- BitStream: takes an InputStream and returns the bits one by one with a
readBit() method, or n bits with readBits(n) (up to 8 bits). It doesn't
implement InputStream. The bit stream is formed by reading the bytes one
by one from the InputStream, and appending its bits to the left of a
long used as a buffer. There is no notion of endianness.

- BinaryTree: decodes the symbols on calling read(BitStream)

I suspect this could be reused for a huffman encoded input stream but I
haven't checked the details yet.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message