Reuse of C# Encoding Objects

The concept of reusing C# objects for OER encoding is the same as was described previously for BER encoding. Basically, all that needs to be done is the creation of a single OER encode buffer object and an object corresponding to the ASN.1 data type to be encoded outside of the processing loop. These objects can then be reused to encode each instance of the messages to be sent. After each message is encoded, the OER buffer must be reset for the next message by using the reset method. See the section on reuse of objects in the BER encoding section for a more thorough discussion and sample code on using this capability.