我读过手册:
For bit-oriented delivery, the bit order for the byte stream format is specified to start with the MSB of the first byte, proceed to the LSB of the first byte, followed by the MSB of the second byte, etc.
在我的应用程序中,我必须处理位。 (例如我有十进制数 5,二进制格式看起来像 00000101) 那么,这是否意味着(根据手册)我读取的位顺序是
<= 0 <= 0 <= 0 <= 0 <= 0 <= 1 <= 0 <= 1 (first read bit I read is 0, second is 0 etc....)
或者它意味着读取位的顺序:
<= 1 <= 0 <= 1 <= 0 <= 0 <= 0 <= 0 <= 0 (first read bit I read is 1, second is 0 etc....)
谢谢
最佳答案
- MSB:最高有效位
- LSB:最低有效位
因此,对于 5 (0000_0101),左侧的位(代表 27)是“最高有效位”,右侧的位(代表 20)是“最不重要”。因此,是的,第一位应该是 0。
关于java - 比特流读取顺序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5595057/