assertThat(len, is(bitsLen));
byte[] buf = baos.toByteArray();
ByteArrayInputStream bais = new ByteArrayInputStream(buf);
BitInputStream bis = new DefaultBitInputStream(bais);
int number = codec.read(bis);
assertThat(number, is(value));
String bitsString = IOUtils.toBitString(buf);
assertThat(bitsString, equalTo("10000000"));