Generated Method Format and Calling Parameters

The signature for the JSON encode method is shown below:

               public void encode(Asn1JsonOutputStream buffer ) 
               throws java.io.IOException

The buffer argument is an Asn1JsonOutputStream object which receives the encoded message. This must be created and initialized before calling any encode method. See the description of this class in the Java Run-Time Classes section for details on how this class is used. Since JSON is a character-based encoding, Asn1JsonOutputStream are constructed on java.io.Writer instances. There is a subclass, Asn1JsonOutputBuffer, that can be used to output to a byte array.

As you can see, the encode methods return void; an exception is thrown if an error occurs. All ASN1C Java exceptions are derived from Asn1Exception. See the section on exceptions for a complete list and description of the various exceptions that can be thrown.