BHSDCodec codec = (BHSDCodec) CodecEncoding.getCodec(i, null, null);
// Test encode-decode with a selection of numbers within the range of the codec
long delta = (codec.largest() - codec.smallest()) / 4;
for (long j = codec.smallest(); j <= codec.largest() + 1; j += delta) {
byte[] encoded = codec.encode(j, 0);
long decoded = codec.decode(new ByteArrayInputStream(encoded),
0);
if (j != decoded) {
fail("Failed with codec: " + codec + " expected: " + j
+ ", got: " + decoded);