Is there a preferred bit order in the bit stream (where the bit stream is somewhat similar to Java Input / OutputStream, but provides bit level granularity)?
I read that the output of the Huffman stage of the DEFLATE algorithm considers the least significant bit (lsb) of the byte, which must be “before” the most significant bit (msb), in order to encode a non-byte value. Is there a reason for choosing the order of lsb-to-msb rather than the order of msb-to-lsb? For example, does this somehow simplify / speed up the decoding (or coding) of the code?
I assume that the "InputBitStream" class in Java will provide some basic operations:
class InputBitStream {
public int readSingleBit() {...}
public int readMultipleBits(int count) {...}
}
DEFLATE bit packing:
http://www.gzip.org/zlib/rfc-deflate.html#packing
source