@Before public void setUp() { bytes = new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; final ByteArrayInputStream bais = new ByteArrayInputStream( bytes ); this.sdis = new SwappedDataInputStream( bais ); }
@Test public void testReadBoolean() throws IOException { bytes = new byte[] { 0x00, 0x01, 0x02, }; final ByteArrayInputStream bais = new ByteArrayInputStream( bytes ); final SwappedDataInputStream sdis = new SwappedDataInputStream( bais ); assertEquals( false, sdis.readBoolean() ); assertEquals( true, sdis.readBoolean() ); assertEquals( true, sdis.readBoolean() ); sdis.close(); }