20, 20, 10, 10, 999, 20, 789, 10, 10, 355, 12345 };
// first 5 of band to be encoded with DELTA5
byte[] bytes1 = Codec.DELTA5
.encode(new int[] { 11, 12, 33, 4000, -555 });
// rest of band to be encoded with a PopulationCodec
PopulationCodec popCodec = new PopulationCodec(Codec.UNSIGNED5,
Codec.BYTE1, Codec.UNSIGNED5);
byte[] bytes2 = popCodec.encode(new int[] { 10, 20 }, new int[] { 0, 1,
2, 1, 0, 2, 2, 2, 1, 1, 0, 2, 0, 1, 1, 0, 0 }, new int[] { 5,
3, 999, 789, 355, 12345 });
byte[] bandEncoded = new byte[bytes1.length + bytes2.length];
System.arraycopy(bytes1, 0, bandEncoded, 0, bytes1.length);
System.arraycopy(bytes2, 0, bandEncoded, bytes1.length, bytes2.length);
RunCodec runCodec = new RunCodec(5, Codec.DELTA5, new PopulationCodec(
Codec.UNSIGNED5, Codec.BYTE1, Codec.UNSIGNED5));
int[] bandDecoded = runCodec.decodeInts(band.length,
new ByteArrayInputStream(bandEncoded));
assertEquals(band.length, bandDecoded.length);
for (int i = 0; i < band.length; i++) {