output.write(value);
}
output.close();
ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
BitInput bitInput = new BitInputImpl(bis);
ArithDecoder decoder = new ArithDecoder(decodeModel);
ArithCodeInputStream input = new ArithCodeInputStream(decoder, bitInput);
for(int value: values) {
assertEquals(value, input.read());