VarLenIntEncoderDecoder { public static VarLenIntDecoder createDecoder() { return new VarLenIntDecoder(); }  static int getBytesRequired(int length); static int decode(DataInput in); static int decode(byte[] srcBytes, int startPos); static int encode(int lengthVal, byte[] destBytes, int startPos); static VarLenIntDecoder createDecoder(); static final int BOUND_ONE_BYTE; static final int BOUND_TWO_BYTE; static final int BOUND_THREE_BYTE; static final int BOUND_FOUR_BYTE; static final int BOUND_FIVE_BYTE; static final int ENCODE_MASK; static final byte CONTINUE_CHUNK; static final byte DECODE_MASK; }
@Test public void testCreateDecoder() throws Exception { VarLenIntDecoder decoder = createDecoder(); byte[] bytes = new byte[100]; int pos = 1; for (int b : bounds) { pos += encode(b, bytes, pos); } decoder.reset(bytes, 1); for (int b : bounds) { assertEquals(b, decoder.decode()); } }