use of com.beanit.asn1bean.compiler.extension_test.non_extensible.ExtendedSequence in project jasn1 by openmuc.
the class ExtensibilityImpliedTest method computeCode.
@BeforeAll
static void computeCode() throws IOException {
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(100, true);
NonExtensibleSequence nonExtensibleSequence = new NonExtensibleSequence();
nonExtensibleSequence.setAge(new BerInteger(5));
os.reset();
nonExtensibleSequence.encode(os);
byte[] nonExtensibleSequenceCode = os.getArray();
ExtendedSequence extendedSequence = new ExtendedSequence();
extendedSequence.setAge(new BerInteger(5));
extendedSequence.setName(new BerVisibleString("name"));
extendedSequence.setSubAge(nonExtensibleSequence);
os.reset();
extendedSequence.encode(os);
byte[] extendedSequenceCode = os.getArray();
extensionCode = Arrays.copyOfRange(extendedSequenceCode, nonExtensibleSequenceCode.length, extendedSequenceCode.length);
ExtendedSequenceAndMore extendedSequenceAndMore = new ExtendedSequenceAndMore();
extendedSequenceAndMore.setExtendedSequence(extendedSequence);
extendedSequenceAndMore.setMore(new BerVisibleString("more"));
os.reset();
extendedSequenceAndMore.encode(os);
extendedSequenceAndMoreCode = os.getArray();
}
Aggregations