clps.appendIntToStream(1000000000);
clps.appendIntToStream(Integer.MAX_VALUE);
ByteArrayInputStream bais = new ByteArrayInputStream(clps
.convertStreamToByteArray());
IntDecoder decoder = new DGapIntDecoder(new NOnesIntDecoder(3));
decoder.reInit(bais);
assertEquals("Wrong value in byte stream", 1, decoder.decode());
assertEquals("Wrong value in byte stream", 10, decoder.decode());
assertEquals("Wrong value in byte stream", 100, decoder.decode());
assertEquals("Wrong value in byte stream", 1000, decoder.decode());
assertEquals("Wrong value in byte stream", 10000, decoder.decode());
assertEquals("Wrong value in byte stream", 100000, decoder.decode());
assertEquals("Wrong value in byte stream", 1000000, decoder.decode());
assertEquals("Wrong value in byte stream", 10000000, decoder.decode());
assertEquals("Wrong value in byte stream", 100000000, decoder.decode());
assertEquals("Wrong value in byte stream", 1000000000, decoder.decode());
assertEquals("Wrong value in byte stream", Integer.MAX_VALUE, decoder.decode());
assertEquals("End of stream not reached", IntDecoder.EOS, decoder.decode());
clps.reset();
decoder.reInit(bais);
assertEquals("End of stream not reached", IntDecoder.EOS, decoder.decode());
}