@Test
public void testAlignByte() throws Exception {

  final byte[] testarray = JBBPUtils.str2bin("01111001 10111000");
  final JBBPBitInputStream in = new JBBPBitInputStream(new ByteArrayInputStream(testarray));
  in.alignByte();
  assertEquals(0, in.getCounter());
  assertEquals(0x19, in.readBits(JBBPBitNumber.BITS_5));
  assertEquals(0, in.getCounter());
  in.alignByte();
  assertEquals(1, in.getCounter());
  assertEquals(0x8, in.readBits(JBBPBitNumber.BITS_4));
  assertEquals(1, in.getCounter());
  assertEquals(0xB, in.readBits(JBBPBitNumber.BITS_4));
  assertEquals(2, in.getCounter());
  assertEquals(-1, in.read());
  assertEquals(2, in.getCounter());
}