是否有一些位流中的位顺序(其中有点流类似于Java的输入/outputStream,但提供了位粒度的粒度)?

我已经读到,放气算法的霍夫曼阶段的输出考虑了“在”最重要的位(MSB)之前的字节的最低意义(LSB),以编码非字节 - 对齐值。是否有理由选择LSB到MSB订购,而不是MSB到LSB订购?例如,这是否以某种方式允许更简单 /更快的解码(或编码)代码?

我认为Java中的“ InputBitStream”类将提供一些基本操作:

class InputBitStream {
    // Optimized for reading a SINGLE bit.
    public int readSingleBit() {...}

    // Optimized for reading large segments of bits,
    // not just readSingleBit() -> put in result -> repeat,
    // but if possible, shifting in a byte at a time.
    public int readMultipleBits(int count) {...}
}

放气位包装:http://www.gzip.org/zlib/rfc-deflate.html#packing

有帮助吗?

解决方案

不,没有标准订单。它取决于所讨论的接口。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top