|
16 | 16 |
|
17 | 17 | package com.igormaznitsa.jbbp.io; |
18 | 18 |
|
19 | | -import static com.igormaznitsa.jbbp.io.JBBPBitNumber.BITS_1; |
20 | | -import static com.igormaznitsa.jbbp.io.JBBPBitNumber.BITS_2; |
21 | | -import static com.igormaznitsa.jbbp.io.JBBPBitNumber.BITS_3; |
22 | | -import static com.igormaznitsa.jbbp.io.JBBPBitNumber.BITS_4; |
23 | | -import static com.igormaznitsa.jbbp.io.JBBPBitNumber.BITS_5; |
24 | | -import static com.igormaznitsa.jbbp.io.JBBPBitNumber.BITS_8; |
| 19 | +import static com.igormaznitsa.jbbp.io.JBBPBitNumber.*; |
25 | 20 | import static com.igormaznitsa.jbbp.io.JBBPByteOrder.BIG_ENDIAN; |
26 | 21 | import static com.igormaznitsa.jbbp.utils.JBBPUtils.bin2str; |
27 | 22 | import static com.igormaznitsa.jbbp.utils.JBBPUtils.str2bin; |
@@ -123,10 +118,12 @@ public void testIsDetectedPartlyReadBitField() throws Exception { |
123 | 118 |
|
124 | 119 | @Test |
125 | 120 | public void testReadMsb0Direct() throws Exception { |
126 | | - byte[] data = str2bin("00000001_101_00001000_00000_01_00_1011_00000"); |
| 121 | + byte[] data = str2bin("10000100_00000001_101_00001000_00000_01_00_1011_00000"); |
127 | 122 |
|
128 | 123 | JBBPBitInputStream in = |
129 | 124 | new JBBPBitInputStream(new ByteArrayInputStream(data), JBBPBitOrder.MSB0_DIRECT); |
| 125 | + assertEquals(1, in.readBits(BITS_1)); |
| 126 | + assertEquals(4, in.readBits(BITS_7)); |
130 | 127 | assertEquals(1, in.readBits(BITS_8)); |
131 | 128 | assertEquals(5, in.readBits(BITS_3)); |
132 | 129 | assertEquals(8, in.readBits(BITS_8)); |
|
0 commit comments