/** * Creates a new context type. * * @param index of this item in the context * @param item to encode */ public ContextType(final int index, final BigInteger item) { this(index, IntegerType.toBytes(item)); }
/** * Creates a new context type. * * @param index of this item in the context * @param item to encode */ public ContextType(final int index, final BigInteger item) { this(index, IntegerType.toBytes(item)); }
/** * Creates a new context type. * * @param index of this item in the context * @param item to encode */ public ContextType(final int index, final BigInteger item) { this(index, IntegerType.toBytes(item)); }
/** * @param expected bytes to compare. * @param integer to encode. * @param unsigned int to compare. * * @throws Exception On test failure. */ @Test(groups = {"asn1"}, dataProvider = "ints") public void encode(final byte[] expected, final BigInteger integer, final BigInteger unsigned) throws Exception { if (integer.intValue() == -1 && expected.length > 1) { // ignore multi byte negative 1 return; } else { Assert.assertEquals(IntegerType.toBytes(integer), expected); } } }