VorbisBitArray { public boolean readBit() { boolean returnValue = (((data[byteOffset] & 0xFF) >> bitOffset) & 0x01) == 1; skipBits(1); return returnValue; } VorbisBitArray(byte[] data); void reset(); boolean readBit(); int readBits(int numBits); void skipBits(int numBits); int getPosition(); void setPosition(int position); int bitsLeft();  }
@Test public void testReadBit() { VorbisBitArray bitArray = new VorbisBitArray(TestUtil.createByteArray(0x5c, 0x50)); assertThat(bitArray.readBit()).isFalse(); assertThat(bitArray.readBit()).isFalse(); assertThat(bitArray.readBit()).isTrue(); assertThat(bitArray.readBit()).isTrue(); assertThat(bitArray.readBit()).isTrue(); assertThat(bitArray.readBit()).isFalse(); assertThat(bitArray.readBit()).isTrue(); assertThat(bitArray.readBit()).isFalse(); assertThat(bitArray.readBit()).isFalse(); assertThat(bitArray.readBit()).isFalse(); assertThat(bitArray.readBit()).isFalse(); assertThat(bitArray.readBit()).isFalse(); assertThat(bitArray.readBit()).isTrue(); assertThat(bitArray.readBit()).isFalse(); assertThat(bitArray.readBit()).isTrue(); assertThat(bitArray.readBit()).isFalse(); }