### Question:
EbcdicPrefixer implements Prefixer { @Override public void encodeLength(int length, byte[] b) { for (int i = nDigits - 1; i >= 0; i--) { b[i] = EBCDIC_DIGITS[length % 10]; length /= 10; } } EbcdicPrefixer(int nDigits); @Override void encodeLength(int length, byte[] b); @Override int decodeLength(byte[] b, int offset); @Override int getPackedLength(); static final EbcdicPrefixer L; static final EbcdicPrefixer LL; static final EbcdicPrefixer LLL; static final EbcdicPrefixer LLLL; }### Answer:
@Test public void testEncode() throws Exception { byte[] b = new byte[2]; EbcdicPrefixer.LL.encodeLength(21, b); TestUtils.assertEquals(new byte[]{(byte)0xF2, (byte)0xF1}, b); }