File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
jbbp/src/test/java/com/igormaznitsa/jbbp/io Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -66,9 +66,21 @@ private static JBBPBitInputStream asInputStreamMSB0(final int... array) {
6666 @ Test
6767 public void testReadLsb0Msb0 () throws Exception {
6868 final byte [] data = new byte [] {0b0000_0001};
69+
70+ JBBPBitInputStream in = new JBBPBitInputStream (new ByteArrayInputStream (data ));
71+ assertEquals (0b0001, in .readBits (BITS_4 ));
72+ assertEquals (0b0000, in .readBits (BITS_4 ));
6973 assertEquals (0b0000_0001, new JBBPBitInputStream (new ByteArrayInputStream (data )).read ());
74+
75+ in = new JBBPBitInputStream (new ByteArrayInputStream (data ), JBBPBitOrder .LSB0 );
76+ assertEquals (0b0001, in .readBits (BITS_4 ));
77+ assertEquals (0b0000, in .readBits (BITS_4 ));
7078 assertEquals (0b0000_0001,
7179 new JBBPBitInputStream (new ByteArrayInputStream (data ), JBBPBitOrder .LSB0 ).read ());
80+
81+ in = new JBBPBitInputStream (new ByteArrayInputStream (data ), JBBPBitOrder .MSB0 );
82+ assertEquals (0b0000, in .readBits (BITS_4 ));
83+ assertEquals (0b1000, in .readBits (BITS_4 ));
7284 assertEquals (0b1000_0000,
7385 new JBBPBitInputStream (new ByteArrayInputStream (data ), JBBPBitOrder .MSB0 ).read ());
7486 }
You can’t perform that action at this time.
0 commit comments