use of com.beanit.asn1bean.compiler.tagging_test.ExplicitlyTaggedSeqOf in project jasn1 by openmuc.
the class TaggingTest method explicitlyTaggedSeqOfIndefiniteTest.
@Test
public void explicitlyTaggedSeqOfIndefiniteTest() throws Exception {
byte[] code = toBytes("BF2180308002010302010400000000");
ExplicitlyTaggedSeqOf seqOf = new ExplicitlyTaggedSeqOf();
InputStream is = new ByteArrayInputStream(code);
int numDecodedBytes = seqOf.decode(is);
assertNotNull(seqOf.getBerInteger());
assertEquals(-1, is.read());
assertEquals(code.length, numDecodedBytes);
}
use of com.beanit.asn1bean.compiler.tagging_test.ExplicitlyTaggedSeqOf in project jasn1 by openmuc.
the class TaggingTest method explicitlyTaggedSeqOfTest.
@Test
public void explicitlyTaggedSeqOfTest() throws Exception {
ExplicitlyTaggedSeqOf seqOf = new ExplicitlyTaggedSeqOf();
List<BerInteger> integerList = seqOf.getBerInteger();
integerList.add(new BerInteger(3));
integerList.add(new BerInteger(4));
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(1000);
seqOf.encode(os);
assertArrayEquals(toBytes("BF21083006020103020104"), os.getArray());
seqOf = new ExplicitlyTaggedSeqOf();
seqOf.decode(new ByteArrayInputStream(os.getArray()));
}
Aggregations