### Question:
BcdPrefixer implements Prefixer { @Override public int decodeLength(byte[] b, int offset) { int len = 0; for (int i = 0; i < (nDigits + 1) / 2; i++) { len = 100 * len + ((b[offset + i] & 0xF0) >> 4) * 10 + (b[offset + i] & 0x0F); } return len; } BcdPrefixer(int nDigits); @Override void encodeLength(int length, byte[] b); @Override int decodeLength(byte[] b, int offset); @Override int getPackedLength(); static final BcdPrefixer L; static final BcdPrefixer LL; static final BcdPrefixer LLL; static final BcdPrefixer LLLL; static final BcdPrefixer LLLLL; }### Answer:
@Test public void testDecode() throws Exception { byte[] b = new byte[]{0x25}; assertEquals(25, BcdPrefixer.LL.decodeLength(b, 0)); }
@Test public void testDecode19() throws Exception { byte[] b = new byte[]{0x19}; assertEquals(19, BcdPrefixer.LL.decodeLength(b, 0)); }
@Test public void testDecode99() throws Exception { byte[] b = new byte[]{(byte)0x99}; assertEquals(99, BcdPrefixer.LL.decodeLength(b, 0)); }