Additional code examples

58 views
Skip to first unread message

Daniel Roythorne

unread,
Aug 14, 2014, 5:48:16 PM8/14/14
to asn1-develo...@googlegroups.com
Hi,

Excuse my ignorance, but I'm wondering if anyone would please be willing to share some Java code examples that go beyond the 'MyHttp' example on the project homepage? Just basic things like creating instances from compiled modules, cloning behaviour, (en|de)code etc.. The unit tests would be great to have too.

Thanks in advance for any help you can provide.

All the best,
Dan

Zhiren Hu

unread,
Aug 20, 2014, 6:32:50 PM8/20/14
to asn1-develo...@googlegroups.com
Hi,

The API is designed to be quite easy to use, here is the code sample for decoding/printing:
byte[] array = ...

Buffer buffer = Buffer.wrap(array, EncodingRules.ALIGNED_PACKED_ENCODING_RULES);

XXX_PDU pdu = (XXX_PDU) XXX_PDU.TYPE.decode(buffer, XXX_PDU.CONVERTER);

XXX_PDU.TYPE.print(pdu, XXX_PDU.CONVERTER, System.out);

Reply all
Reply to author
Forward
0 new messages