Search in sources :

Example 1 with ExplicitlyTaggedSetOf

use of com.beanit.asn1bean.compiler.tagging_test.ExplicitlyTaggedSetOf in project jasn1 by openmuc.

the class TaggingTest method explicitlyTaggedSetOfTest.

@Test
public void explicitlyTaggedSetOfTest() throws Exception {
    ExplicitlyTaggedSetOf setOf = new ExplicitlyTaggedSetOf();
    List<BerInteger> integerList = setOf.getBerInteger();
    integerList.add(new BerInteger(3));
    integerList.add(new BerInteger(4));
    ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(1000);
    setOf.encode(os);
    assertArrayEquals(toBytes("BF21083106020103020104"), os.getArray());
    setOf = new ExplicitlyTaggedSetOf();
    setOf.decode(new ByteArrayInputStream(os.getArray()));
}
Also used : ExplicitlyTaggedSetOf(com.beanit.asn1bean.compiler.tagging_test.ExplicitlyTaggedSetOf) ByteArrayInputStream(java.io.ByteArrayInputStream) BerInteger(com.beanit.asn1bean.ber.types.BerInteger) ReverseByteArrayOutputStream(com.beanit.asn1bean.ber.ReverseByteArrayOutputStream) Test(org.junit.jupiter.api.Test)

Aggregations

ReverseByteArrayOutputStream (com.beanit.asn1bean.ber.ReverseByteArrayOutputStream)1 BerInteger (com.beanit.asn1bean.ber.types.BerInteger)1 ExplicitlyTaggedSetOf (com.beanit.asn1bean.compiler.tagging_test.ExplicitlyTaggedSetOf)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 Test (org.junit.jupiter.api.Test)1